On Thu, Nov 18, 2021 at 2:51 PM Chris Murphy <lists@xxxxxxxxxxxxxxxxx> wrote: > > How to do swapfiles? > > Currently I'm creating a "swap" subvolume in the top-level of the file > system and /etc/fstab looks like this > > UUID=$FSUUID /var/swap btrfs noatime,subvol=swap 0 0 > /var/swap/swapfile1 none swap defaults 0 0 > > This seems to work reliably after hundreds of boots. > > a. Is this naming convention for the subvolume adequate? Seems like it > can just be "swap" because the GPT method is just a single partition > type GUID that's shared by multiboot Linux setups, i.e. not arch or > distro specific > b. Is the mount point, /var/swap, OK? > c. What should the additional naming convention be for the swapfile > itself so swapon happens automatically? Actually I'm thinking of something different suddenly... because without user ownership of swapfiles, and instead systemd having domain over this, it's perhaps more like: /x-systemd.auto/swap -> /run/systemd/swap And then systemd just manages the files in that directory per policy, e.g. do on demand creation of swapfiles with variable size increments, as well as cleanup. -- Chris Murphy