[systemd-devel] prevent unmount of single partitions on shutdown

Lennart Poettering lennart at poettering.net
Wed Sep 11 08:16:01 PDT 2013


On Wed, 21.08.13 05:21, Stephan Raue (mailinglists at openelec.tv) wrote:

> Hi,
> 
> i try to port systemd on a own embedded OS which is stored in a
> squashfs file. This file is on a fat partition (later mounted as
> /flash) on the drive.
> 
> In our own initramfs (which dont uses systemd) /flash will be
> mounted and then the Squashfs file as /sysroot. later we do a
> switch_root and start systemd. On shutdown systemd trys now (5
> times) to unmount /flash and times out later with a error message.

Times out? How that?

Normally, the tight shutdown loop should just get EBUSY and then give up
giving control back to the initrd...

What precisely is timing out here?

The final shutdown loop is just a tight loop with no sleeps or
anything. It tries to detach everything, but ther is nothing that should
block. So the worst thing that might happen is that you get a bit of
error noise, but that'd be it...

> This delays the shutdown/reboot much. Systemd also trys to cleanup
> /dev/loop0. I need to prevent systemd to unmount /flash and clean
> /dev/loop0 (which is the / mount from the squashfs file).

Well, but detaching /dev/loop0 should just give a EBUSY too here, and
systemd-shutdown should immediately proceed...

> can i actually prevent this in some way and if nout could i request
> a feature to add a mount option which if avaible prevents systemd
> from unmounting single partitions and cleanup /dev/loopX if its
> still mounted as / ? I need this as mount option or a systemd unit
> file but for fstab based systems it would be usefull as a fstab
> option too (we dont use fstab)

I'd really like to understand what is supposed to time out here first...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list