OpenVZ Forum


Home » General » Support » Prevent unmount inside VE
Re: Prevent unmount inside VE [message #10139 is a reply to message #10137] Fri, 09 February 2007 11:18 Go to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

Yes, VE root can do almost everything in VE, including umounting bind-mounted directories.

I offer you the solution I use, but there can be more smart solutions.

The essence of the soulution is to make directory, to which bind-mount is produced _busy_ from VE0. In your case:


root@hn:/# mount --bind /mnt/ /vz/root/100/mnt/
root@hn:/# cd /vz/root/100/mnt/ <--- this makes bind-mount busy
root@hn:/# vzctl enter 100
root@ve:/# cat /proc/mounts
simfs / simfs rw 0 0
ext3 /mnt ext3 rw,data=ordered 0 0
root@ve:/# umount /mnt/ <---- doesn't work
umount: /mnt: device is busy
umount: /mnt: device is busy
root@ve:/# exit

By various ways it can be automatized.

As concerns redudant information that `mount` still shows in your example,
this is because it gets information from /etc/mtab on HN, which is of course not updated when umounting in VE occurs. This can be prevented by bind-mounting with -n option.

HTH,
Vasily
 
Read Message
Read Message
Previous Topic: VPS dies
Next Topic: 2.6.18-ovz028test015.1-enterprise
Goto Forum:
  


Current Time: Thu Jul 24 11:40:52 GMT 2025

Total time taken to generate the page: 0.29581 seconds