[Pkg-sysvinit-devel] Bug#339023: initscripts: umountroot fails if / is bind-mounted somewhere

Giacomo Mulas gmulas at ca.astro.it
Mon Nov 14 15:22:31 UTC 2005


Subject: initscripts: umountroot fails if / is bind-mounted somewhere
Package: initscripts
Version: 2.86.ds1-5
Severity: wishlist
Tags: patch

I ran into a subtle problem with my amd64 computer which drove me crazy for
a while, until I tracked it down. Upon shutdown or reboot, the root
filesystem would not be unmounted nor be remounted readonly, with the result 
that I always had a dirty root filesystem. It was not a big issue, since it
always had time to settle and write buffers to disk, but it was annoying.
I finally found out that this was due to having the root director
bind-mounted by default on a chroot cage (I run an amd64 bit system and have
a chrooted i386 installation for compatibility reasons). Upon shutting down,
when trying to umount the root filesystem umountroot found the line saying
/    /ia32/amd64    none    bind            0       3
and tried to umount that instead of the root filesystem, which remained
mounted rw. Since in the sid version of mount it is possible to specify that
the command must be applied only to filesystems mounted with (or without) 
some given options, I solved my problem by replacing the line
mount -n -o remount,ro /
in the umountroot script with
mount -n -O no bind -o remount,ro /
With the above, the root filesystem may have been bind-mounted any number of
times and it will cause no problems, since the bind mounts have been
umounted already at this stage and the "-O no bind" options tell mount to
ignore any entries referring to bind mounts.

While this is a rather peculiar problem, it is one which is common to any
people who bind-mount the root filesystem anywhere, and is trivial to fix
with no side-effects, with the one-liner above. It would also be nice to
come up with a solution which works on sarge as well as with sid, but I did
not dig into it since I run sid...

best regards
Giacomo

-- System Information:
Debian Release: testing/unstable
   APT prefers unstable
   APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-turion64-jak
Locale: LANG=it_IT.UTF-8 at euro, LC_CTYPE=it_IT.UTF-8 at euro (charmap=UTF-8) (ignored: LC_ALL set to it_IT.UTF-8)

Versions of packages initscripts depends on:
ii  coreutils                     5.93-2     The GNU core utilities
ii  dpkg                          1.13.11    package maintenance system for Deb
ii  e2fsprogs                     1.38-2     ext2 file system utilities and lib
ii  libc6                         2.3.5-7    GNU C Library: Shared libraries an
ii  lsb-base                      3.0-11     Linux Standard Base 3.0 init scrip
ii  util-linux                    2.12p-8    Miscellaneous system utilities

initscripts recommends no packages.

-- no debconf information


-- 
_________________________________________________________________

Giacomo Mulas <gmulas at ca.astro.it>
_________________________________________________________________

OSSERVATORIO ASTRONOMICO DI CAGLIARI
Str. 54, Loc. Poggio dei Pini * 09012 Capoterra (CA)

Tel. (OAC): +39 070 71180 248     Fax : +39 070 71180 222
Tel. (UNICA): +39 070 675 4916
_________________________________________________________________

"When the storms are raging around you, stay right where you are"
                          (Freddy Mercury)
_________________________________________________________________

-- 
Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.





More information about the Pkg-sysvinit-devel mailing list