Bug#338801: umountfs: should use /proc/mounts
If you understand you correctly, you want to replace /etc/mtab with /proc/mounts for umountsfs and umountnfs.sh. Here is an untested patch to do this change. Please test it, and let me know if it solves your problem. If it work, this bug should be tagged 'patch'. Index: debian/initscripts/etc/init.d/umountfs === --- debian/initscripts/etc/init.d/umountfs (revision 154) +++ debian/initscripts/etc/init.d/umountfs (working copy) @@ -21,7 +21,7 @@ log_action_begin_msg Unmounting local filesystems # List all mounts, deepest mount point first -LANG=C sort -r -k 2 /etc/mtab | +LANG=C sort -r -k 2 /proc/mounts | ( DIRS= while read DEV DIR TYPE REST ; do Index: debian/initscripts/etc/init.d/umountnfs.sh === --- debian/initscripts/etc/init.d/umountnfs.sh (revision 154) +++ debian/initscripts/etc/init.d/umountnfs.sh (working copy) @@ -73,7 +73,7 @@ then umount $FLAGS $DIRS fi - ) /etc/mtab + ) /proc/mounts log_action_end_msg 0 } -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#338801: umountfs: should use /proc/mounts
Petter Reinholdtsen wrote: -LANG=C sort -r -k 2 /etc/mtab | +LANG=C sort -r -k 2 /proc/mounts | Is it not necessary to unmount bind mounts too? -- Thomas Hood -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#338801: umountfs: should use /proc/mounts
On Sat, Nov 19, 2005 at 11:17:36PM +0100, Thomas Hood wrote: Petter Reinholdtsen wrote: -LANG=C sort -r -k 2 /etc/mtab | +LANG=C sort -r -k 2 /proc/mounts | Is it not necessary to unmount bind mounts too? Bind mounts will show up in both /etc/mtab and /proc/mounts. Rbind mounts will show up once in /etc/mtab, and once per bound FS in /proc/mounts. -- Daniel Jacobowitz CodeSourcery, LLC -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#338801: umountfs: should use /proc/mounts
Package: initscripts Version: 2.86.ds1-4 Severity: normal /etc/mtab isn't a reliable way to find out what is currently mounted. Not only might it contain stale entries, but also see the bug I just filed on mount, where it fails to contain sub-mounts produced by mount --rbind. As a result, if you have anything in your /etc/fstab containing the rbind option that causes more than one filesystem to be bind mounted, umount will fail. And then, because it failed to unmount a bind mount of my root filesystem, it remounted my root filesystem read-only. Hilarity and dirty filesystems ensued. As far as I can tell, getting the list of mounts from /proc/mounts instead of /etc/mtab should work fine. -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.14-rc5 Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) Versions of packages initscripts depends on: ii coreutils 5.2.1-2.1 The GNU core utilities ii dpkg 1.13.11package maintenance system for Deb ii e2fsprogs 1.38-2 ext2 file system utilities and lib ii libc6 2.3.5-7GNU C Library: Shared libraries an ii lsb-base 3.0-11 Linux Standard Base 3.0 init scrip ii util-linux2.12p-8Miscellaneous system utilities initscripts recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]