[Vserver] Remounting external drive into vserver using --bind failed

From: Stefan Hepp <s.hepp_at_gentics.com>
Date: Thu 28 Sep 2006 - 16:08:55 BST
Message-ID: <451BE587.6070503@gentics.com>

Hi,

I am trying to mount an external harddisk into a vserver, but ran into
some troubles when using mount --bind/umount.

So, here is my setup:
Debian 3.1 stable, Linux 2.6.17.11-grsec2.1.9-vs2.0.2 (self-compiled)
util-vserver from testing, version 0.30.210-10
udev from testing, version 0.093-1
/mnt/data second, big harddisk, ext3
/media/usb0 external harddisk, ext3

And here is what I do:
# vnamespace -e data mount --bind /media/usb0
/mnt/data/vservers/data/media/usb0
works, can see files in vserver

# vnamespace -e data umount /mnt/data/vservers/data/media/usb0
works too

Doing all this once again works too, however, when I unmount the bind,
then unplug the drive (the device is removed, then usbmount unmounts
/media/usb0) and plug it in again (device is created and mounted to
/media/usb0 again), the trouble starts:

# vnamespace -e data mount --bind /media/usb0
/mnt/data/vservers/data/media/usb0
does not work, vnamespace -e data ls -a /media/usb0 doesn't show a
single entry (not even . and ..)
the bind shows up in /proc/mounts

# vnamespace -e data mount --bind /media/usb0/Temp
/mnt/data/vservers/data/media/usb0
mount: special device /media/usb0/Temp does not exist

# touch /media/usb0/Temp/test.txt
works..

# vnamespace -e data umount /mnt/data/vservers/data/media/usb0
works too, ls shows . and ..

# umount /media/usb0
# vnamespace -e data mount /dev/sdb1 /mnt/data/vservers/data/media/usb0
works. no problems when mounting the device itself, even when the device
is removed while still mounted.

After restarting the vserver, bind works again until the drive is unplugged.
Unmounting /media/usb0 before it is removed, using --rbind or binding a
sub-directory does not make any difference.

This makes it impossible to bind a directory from the external harddisk
into a vserver without restarting the vserver each time.
I am currently trying to hack usbmount to remount the device itself
without using --bind, which works for me, but simply binding would make
it a lot easier ;) .

(For the records: testme.sh and testfs.sh report no errors)

Regards,
  Stefan

_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Thu Sep 28 16:11:27 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 28 Sep 2006 - 16:11:30 BST by hypermail 2.1.8