[systemd-devel] Shutdown root fs on loop device

Tomasz Torcz tomek at pipebreaker.pl
Fri Apr 22 11:02:58 UTC 2016


On Fri, Apr 22, 2016 at 11:49:09AM +0200, Michael Lipp wrote:
> Hi,
> 
> I have some PCs where I have to store the Linux root file system as a
> large file in Window's NTFS file system. Everything boots fine. The NTFS
> file system is mounted as ntfs-3g in the initial ramfs as /host, the
> loopback device is created (using /host/Linux/image.img) and used as root.
> 
> However, the system doesn't shut down cleanly, usually it simply hangs.
> I admit that it isn't easy to solve this situation on shutdown. When
> executing findmnt in the running Linux system, the only "hint" is
> /dev/loop0 being mounted as root. The NTFS mount doesn't appear at all.
> It only shows in systemctl status, which starts with
> 
> init.scope
> |.   1 /sbin/init
> |- 155 mount.ntfs-3g -o permissions /dev/sda2 /host
> 
> Is it possible to configure systemd-shutdown somehow (e.g. hook
> scripts)? Or do I have to write my own systemd-shutdown?

  You have to patch ntfs-3g to marks itself as non-killable 
root storage provider (with '@'):
https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/

-- 
Tomasz Torcz       ,,(...) today's high-end is tomorrow's embedded processor.''
xmpp: zdzichubg at chrome.pl                      -- Mitchell Blank on LKML



More information about the systemd-devel mailing list