Bug 1129205
Summary: | fallocate to create swap file creates a file with holes | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | George R. Goffe <grgoffe> |
Component: | util-linux | Assignee: | Karel Zak <kzak> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 20 | CC: | jonathan, kzak |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-12-17 13:02:13 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
George R. Goffe
2014-08-12 10:00:18 UTC
Well, which FS type are you using? Does it work when you create the file by another way? What about if you create loop device from the file and then use the device for swapon? See NOTES in swapon man page -- for example btrfs does not implement bmap() in kernel, so swapfiles on btrfs are impossible. Karel, The fs is xfs. How else does one create a swapfile? Regards, George... Sorry for delay,
> How else does one create a swapfile?
dd if=/dev/zero of=swapfile count=8000 bs=1MiB
the problem with fallocate(1) or truncate(1) is that it uses filesystem ioctls to make the allocation fast and effective, the disadvantage is that it does not physically allocate the space -- but swapon(2) syscall requires a real space.
It seems we need a note about it to fallocate(1) man page.
|