[systemd-devel] the need for a discoverable sub-volumes specification

Chris Murphy lists at colorremedies.com
Fri Dec 10 19:14:00 UTC 2021


On Thu, Nov 4, 2021 at 9:39 AM Lennart Poettering
<lennart at poettering.net> wrote:

> 3. Inside the "@auto" dir of the "super-root" fs, have dirs named
>    <type>[:<namewithversion>]. The type should have a similar vocubulary
>    as the GPT spec type UUIDs, but probably use textual identifiers
>    rater than UUIDs, simply because naming dirs by uuids is
>    weird. Examples:
>
>    /@auto/root-x86-64:fedora_36.0/
>    /@auto/root-x86-64:fedora_36.1/
>    /@auto/root-x86-64:fedora_37.1/
>    /@auto/home/
>    /@auto/srv/
>    /@auto/tmp/
>
>    Which would be assembled by the initrd into the following via bind
>    mounts:
>
>    /         → /@auto/root-x86-64:fedora_37.1/
>    /home/    → /@auto/home/
>    /srv/     → /@auto/srv/
>    /var/tmp/ → /@auto/tmp/

What about arbitrary mountpoints and their subvolumes? Things we can't
predict in advance for all use cases? For example:

For my non-emphemeral systems:

* /var/log is a directory contained in subvolume "varlog-x86-64:fedora.35"
* /var/lib/libvirt/images is a directory contained in subvolume
"varlibvirtimages-x86-64:fedora.35"
* /var/lib/flatpak is a directory contained in a subvolume
"varlibflatpak-x86-64:any" - as it isn't Fedora specific, uses its own
versioning so in this case I'd expect it gets mounted with any
distribution.

These exist so they are excluded from a snapshot and rollback regime
that applies to "root-x86-64:fedora.35" which contains usr/ var/ etc/
A rollback of root does not rollback the systemd journal, VM images,
or flatpaks.

Is space a valid separator in the name of the subvolume? Or
underscore? This would become / to define the path to the mount point.

Additionally, I'm noticing that none of 'journalctl -o verbose' or
json or export shows what subvolume was mounted at each mount point. I
need to use systemd debug for this information to be included in the
journal. Assembly of versioned roots is probably useful logging
information by default. e.g.

Dec 10 10:45:00 fovo.local systemd[1]: Mounting
'@auto/root-x86-64:fedora.35' at /sysroot...
Dec 10 10:45:11 fovo.local systemd[1]: Mounting '@auto/home' at /home...
Dec 10 10:45:11 fovo.local systemd[1]: Mounting '@auto/varlibflatpak'
at /var/lib/flatpak...
Dec 10 10:45:11 fovo.local systemd[1]: Mounting
'@auto/varlibvirtimages-x86-64:fedora.35 at /var/lib/libvirt/images...
Dec 10 10:45:11 fovo.local systemd[1]: Mounting
'@auto/varlog-x86-64:fedora.35' at /var/log...
Dec 10 10:45:11 fovo.local systemd[1]: Mounting '@auto/swap' at /var/swap...


-- 
Chris Murphy


More information about the systemd-devel mailing list