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

Colin Guthrie gmane at colin.guthr.ie
Wed Aug 21 02:56:57 PDT 2013


'Twas brillig, and Zbigniew Jędrzejewski-Szmek at 21/08/13 04:38 did
gyre and gimble:
> On Wed, Aug 21, 2013 at 05:21:59AM +0200, Stephan Raue 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.
>> 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).
>>
>> 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 don't think it's possible currently with fstab. But with
> a mount unit, I think
>   DefaultDependencies=no
>   RequiredBy=-.mount
> should work. Have you tried something like that?

Hmm, I thought the umount logic was such that it just tries to unmount
everything from/proc/mounts rather than looking at units etc.

I asked a similar question a while back and we figured at the time that
adding a mount option might be a solution as there is already a fstab
option to indicate a given filesystem should be mounted in the initrd,
and it would make sense to honor that during shutdown (by not trying to
umount it), but the problem was the umount loop doesn't read fstab or
any mount options to check...

See http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/11210 and
more recently
http://comments.gmane.org/gmane.comp.sysutils.systemd.devel/12048 for
similar topics.

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/



More information about the systemd-devel mailing list