[Pkg-sysvinit-devel] /bin/mountpoint bug: mount -o bind /dir /dir, creates a mountpoint for which /bin/mountpoint is unsuccessful

Zenaan Harkness zen at freedbms.net
Thu Oct 28 13:15:12 UTC 2010


Hi, to use 'mount --make-rshared' on say /media or /mnt, requires that
I first run:
mount -o bind /media /media
to create a mountpoint at /media, so that subsequently I can successfully run:
mount --make-rshared /media

This is useful when using chroots, as I do.

I was using "mountpoint -q $DIR" to determine if an arbitrary
directory was mounted or not, in my chroot u/mount script.
Unfortunately this broke when I started using "mount -o bind /media
/media".

So since /bin/mountpoint does not work, I am instead now using:
if mount | grep "on ${DIR} type" > /dev/null; then ...; fi

I just checked initscripts in a Ubuntu 10.04 chroot guest (initscripts
"Version: 2.87dsf-4ubuntu17"),
on my Ubuntu 8.04 host, and /bin/mountpoint there displays the same bug.
My Ubuntu 8.04 uname -a:
Linux ip61 2.6.24-28-generic #1 SMP Sat Oct 16 17:46:03 UTC 2010 i686 GNU/Linux
Initscripts Version: 2.86.ds1-14.1ubuntu45.1

Hope the above is useful,
Zenaan



More information about the Pkg-sysvinit-devel mailing list