OpenVZ Forum


Home » General » Support » vps.mount and vps.unmount
vps.mount and vps.unmount [message #21973] Thu, 18 October 2007 10:21 Go to previous message
belkhal is currently offline  belkhal
Messages: 9
Registered: October 2007
Junior Member
I have a particular partition /dev/sdb6 that is mounted in the HWN as /share:

/dev/sdb6 on /share type ext3 (rw)


I am trying to bind mount this within all my VE's as a global shared directory.

This works:
# vzctl start 101
# mount --bind /share /vz/root/101/share
# vzctl exec 101 ll /share
dr-------- 2 root root 4096 2007-10-17 23:29 keys
-rw-r--r-- 1 root root  922 2007-10-18 00:02 sources.list
# umount /vz/root/101/share
# vzctl exec 101 ll /share
total 0
# vzctl stop 101


This also works:
# vzctl mount 101
# mount --bind /share /vz/root/101/share
# ll /vz/root/101/share
dr-------- 2 root root 4096 2007-10-17 23:29 keys
-rw-r--r-- 1 root root  922 2007-10-18 00:02 sources.list
# umount /vz/root/101/share
# ll /vz/root/101/share
total 0
# vzctl umount


But, for some reason, this doesn't work:

/etc/vz/conf/vps.mount
#!/bin/bash
mount --bind /share /vz/root/101/share
exit ${?}

/etc/vz/conf/vps.umount
#!/bin/bash
umount /vz/root/101/share
exit ${?}


It works okay when mounting/starting the VE; however, when I stop/umount the VE, I get an error that says:

Stopping VE ...
VE was stopped
/dev/sdb6 umounted
could not umount /vz/root/101/share - trying /share instead
umount: /share: not mounted
could not umount /vz/root/101/share - trying /share instead
umount: /share: not mounted
Error executing umount script /etc/vz/conf/vps.umount


It actually umounts the /share on my HWN and then errors out. Then, since the script returns an error, the VE's private area is never umounted from /vz/root/101.

Anyone know what's wrong? Does a VE automatically remove its own mounts when shutting down?

Thanks
 
Read Message
Read Message
Read Message
Previous Topic: 3 crashes today -
Next Topic: Howto set static MAC for bridge device?
Goto Forum:
  


Current Time: Mon Jun 23 03:04:38 GMT 2025

Total time taken to generate the page: 0.04992 seconds