[systemd-devel] the need for a discoverable sub-volumes specification
Lennart Poettering
lennart at poettering.net
Fri Nov 19 09:20:28 UTC 2021
On Do, 18.11.21 15:01, Chris Murphy (lists at colorremedies.com) wrote:
> On Thu, Nov 18, 2021 at 2:51 PM Chris Murphy <lists at colorremedies.com> 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
I'd be conservative with mounting disk stuff to /run/. We do this for
removable disks because the mount points are kinda dynamic, hence it
makes sense, but for this case it sounds unnecessary, /var/swap sounds
fine to me, in particular as the /var/ partition actually sounds like
the right place to it if /var/swap/ is not a mount point in itself but
just a plain subdir.
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list