How to make systemd ignore a mountpoint during shutdown process?

I mounted an overlayfs mounted on /mnt/overlay. I noticed that systemd unmount mountpoints indiscriminately upon shutdown including /mnt/overlay. How to make /mnt/overlay to be ignore by systemd. I will just want to unmount it when final target is reached. Also how to log all the systemd shutdown process?

Hi @mistfire,

Add and After= directive to the [Unit] section of the mount unit with the target you want it to be after.

See:

https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html

Hope this helps!

Edit:

This might also help:

https://serverfault.com/a/1058947

…to get the full list of reverse dependencies for shutdown-target as asked in the original post, was:

systemctl list-dependencies --after shutdown.target
1 Like