On Sat, Jul 11, 2020 at 02:38:26PM -0400, Ken D'Ambrosio wrote: > Hi! I just saw this mentioned on a BBS I'm on: > https://fedoraproject.org/wiki/Changes/BtrfsByDefault > > I'll admit, I'm incredibly surprised, and pleased, to see that this > might happen. I do have three items of concern as Joe End User. (Do > note that for home use (where I use btrfs) I'm usually on Ubuntu or a > variant and not RH, if that matters.) > > * Swap files. At least last time I checked, it was a PITA to take a > snapshot of a volume that had a swapfile on it -- I wound up writing a > wrapper that goes, does a swapoff, removes the file, creates the > snapshot, and then re-creates the file. Is this still "a thing"? Or > is there a way to work around that that isn't kludgey? The workaround is to use separate subvolume for swapfile. Anything else would cause only problems. Imagine you have a swapfile on root partition, take frequent snapshots. As the swapfile contents change during system use, the shared blocks get unshared and occupy more space. In the end, each rootfs snapshot could have it's own swapfile with useless data. Requiring the separate subvolume was a compromise, it's not ideal but IMHO at least makes things clear. Deleting a swapfile will release the blocks, there's only one instance of the swapfile (for swapon/swapoff).
