[systemd-devel] rootnfs + rootovl (diskless client shutdown problem)

Matteo Guglielmi Matteo.Guglielmi at dalco.ch
Mon Oct 28 09:47:58 UTC 2019


On a live server I have a centos 8.0 installation

which is exported via nfs to a bunch of diskless
clients.

In order to have an independent rw root file system
on each client I have installed the following dracut
module:

/usr/lib/dracut/modules.d/90overlay-root

which I did manually import from the installation of
the dracut package on a debian buster system.

The provided kernel option 'rootovl' used by the
diskless clients works perfectly.

This is how the mount points look like when a
diskless client mounts the live centos 8 system in
rw mode (client can perform maintenance tasks to
update the live root file system permanently):

Filesystem                  Type      Size  Used Avail Use% Mounted on
devtmpfs                    devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs                       tmpfs     2.0G     0  2.0G   0% /dev/shm
tmpfs                       tmpfs     2.0G   17M  1.9G   1% /run
tmpfs                       tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
172.16.16.38:/srv/live/cos8 nfs       192G  137G   56G  72% /
tmpfs                       tmpfs     2.0G     0  2.0G   0% /var/tmp
tmpfs                       tmpfs     2.0G     0  2.0G   0% /tmp
live:/srv/live/home         nfs       192G  137G   56G  72% /home
live:/srv/live/opt          nfs       192G  137G   56G  72% /opt
live:/srv/live/root         nfs       192G  137G   56G  72% /root
tmpfs                       tmpfs     392M     0  392M   0% /run/user/0

And this is how the mount points look like when a
diskless client mounts the live centos 8 root file
system in overlay mode using the rootovl kernel option
(client changes to the root fs are not persistent across
reboots):

Filesystem                  Type      Size  Used Avail Use% Mounted on
devtmpfs                    devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs                       tmpfs     2.0G     0  2.0G   0% /dev/shm
tmpfs                       tmpfs     2.0G   17M  1.9G   1% /run
tmpfs                       tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
overlay                     overlay   2.0G  6.7M  2.0G   1% /
tmpfs                       tmpfs     2.0G  6.7M  2.0G   1% /live/cow
172.16.16.38:/srv/live/cos8 nfs       192G  137G   56G  72% /live/image
tmpfs                       tmpfs     2.0G     0  2.0G   0% /tmp
tmpfs                       tmpfs     2.0G     0  2.0G   0% /var/tmp
live:/srv/live/opt          nfs       192G  137G   56G  72% /opt
live:/srv/live/home         nfs       192G  137G   56G  72% /home
live:/srv/live/root         nfs       192G  137G   56G  72% /root
tmpfs                       tmpfs     392M     0  392M   0% /run/user/0


As you can see,

/live/image is now the lower ro part of the overlay
(i.e. the live rootnfs mounted in ro mode).


During the shutdown process of a diskless client in
overaly mode I see the following logs almost at the
beginning of it:

[ OK ] Stopped target Remote File System.
       Unmounting /live/image...          <<<<===!!!
       Unmounting /opt...
       Unmounting /root...
       Unmounting /home...
...

which poses a problem because the ro lower part of
the overlay is unmounted while the overlay (/) is
still active.


In fact,

almost 20% of the time I get a kernel panic error
due to a bunch of missing libraries.


How can I instruct systemd to avoid unmounting

/live/image (or postpone it to a later moment)?

while the diskless client is rebooting or shutting
down?


Thank you.



More information about the systemd-devel mailing list