[Pkg-sysvinit-devel] Unexpected problem with /etc/mtab
-> /proc/mounts
Henrique de Moraes Holschuh
hmh at debian.org
Mon Jan 23 02:10:18 UTC 2006
Hi Thomas!
On Sat, 21 Jan 2006, Thomas Hood wrote:
> Miquel van Smoorenburg wrote:
> > Ehm, I haven't been following the development due to a chronic lack of
> > time, but using /proc/mounts instead of /etc/mtab when umounting
> > probably breaks loopback mounts.
>
>
> I haven't tested unmounting it but loopback mounts do appear in /proc/mounts:
>
> sudo losetup /dev/loop/0 foo
> sudo mke2fs /dev/loop/0
> sudo mkdir /mnt/loop
> sudo mount /dev/loop/0 /mnt/loop
> cat /proc/mounts
> [...]
> /dev/loop/0 /mnt/loop ext2 rw,nogrpid 0 0
>
> How would the problem arise?
I have been always told that /etc/mtab has MORE data about loopback mounts
than /proc/mount, so you may have to compare them.
I repeat my idea: we should parse /etc/mtab, THEN parse /proc/mounts (and
that does mean read /proc/mounts only after completing /etc/mtab). That
will take care of everything, I think.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
More information about the Pkg-sysvinit-devel
mailing list