New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/swap.img w/fallocate has holes #3211
Comments
Launchpad user Ebbex(eb4x) wrote on 2018-07-16T18:31:18.119623+00:00 So I've checked it out, and ext4 seems to work fine with fallocate. It could perhaps be considered a filesystem-bug as it seems that some xfs-developers are aware of the issue; https://www.spinics.net/lists/linux-mm/msg147100.html But it would be beneficial to have a work-around until that gets sorted. |
Launchpad user Ryan Harper(raharper) wrote on 2018-07-16T19:04:29.105846+00:00 Yes, from my reading, this is an xfs (btrfs) specific issue w.r.t how they don't handle converting a fallocated file into swap space. I think we'll likely do the following:
Alternatively, one can use a swap partition instead of a file on the filesystem which avoids this path; that may be preferred to avoid dd'ing gigabytes of data. |
Launchpad user Scott Moser(smoser) wrote on 2018-11-30T14:32:24.906619+00:00 The same basic issue is in cloud-init |
Launchpad user Chad Smith(chad.smith) wrote on 2020-01-23T19:01:24.087652+00:00 A fix landed inin cloud-init upstream for this issue @ 6603706 If this is still a problem, please re-open this bug task for cloud-init. |
Launchpad user Dan Watkins(oddbloke) wrote on 2020-02-20T21:15:00.457841+00:00 This bug is believed to be fixed in cloud-init in version 20.1. If this is still a problem for you, please make a comment and set the state back to New Thank you. |
This bug was originally filed in Launchpad as LP: #1781781
Launchpad details
Launchpad user Ebbex(eb4x) wrote on 2018-07-15T08:35:52.392722+00:00
The /swap.img file on an XFS root filesystem is not being used. The dmesg says it "has holes".
From the swapon manpage;
The swap file implementation in the kernel expects to be able to write to the file directly, without the assistance of the filesystem. This is a problem on preallocated files (e.g. fallocate(1)) on filesystems like XFS or ext4, and on copy-on-write filesystems like btrfs.
It is recommended to use dd(1) and /dev/zero to avoid holes on XFS and ext4.
I've tracked down this commit which seems to be a step in the right direction;
canonical/curtin@a909966
The text was updated successfully, but these errors were encountered: