OpenVZ Forum


Home » General » Support » *SOLVED* strange mount/umount issues
*SOLVED* strange mount/umount issues [message #12706] Mon, 07 May 2007 15:18 Go to next message
coolcold is currently offline  coolcold
Messages: 11
Registered: May 2007
Location: Moscow, Russia
Junior Member
I've got several VEs, one is for light web server as frontend ( nginx ) and some VE with user's apaches/other stuff ( backends )

One of users wanted to view frontend logs, so i decided to mount dir from FRONTEND to BACKEND.

veid 1010 is FRONTEND, and veid 1600 is BACKEND.

1600.mount is:

root@nekobus:/etc/vz/conf# cat 1600.mount
#!/bin/bash
# Mount script to bind-mount /var/something into a VPS
[ -f /etc/vz/vz.conf ] || exit 1
[ -f $VE_CONFFILE ] || exit 1

. /etc/vz/vz.conf
. $VE_CONFFILE

echo -n "mounting nginx logs inside pnoenix..."
if [[ -d $NGINX_DIR/var/log/nginx/phoenixlogs ]]
then
    mount --bind $NGINX_DIR/var/log/nginx/phoenixlogs $VE_ROOT/home/phoenix/nginx-logs
    echo "  done"
else
    echo "  failed"
fi

where NGINX_DIR is path to FRONTEND's root ( /var/lib/vz/root/1010/ )
Then I start BACKEND and mount script works, we can see:

root@nekobus:/etc/vz/conf# vzctl exec 1600 mount|grep nginx
simfs on /home/phoenix/nginx-logs type simfs (rw)
root@nekobus:/etc/vz/conf# mount |grep nginx
/var/lib/vz/root/1010/var/log/nginx/phoenixlogs on /var/lib/vz/root/1600/home/phoenix/nginx-logs type none (rw,bind)


then i stop BACKEND and my umount script is:

root@nekobus:/etc/vz/conf# cat 1600.umount
#!/bin/bash
# Mount script to bind-mount /var/something into a VPS
[ -f /etc/vz/vz.conf ] || exit 1
[ -f $VE_CONFFILE ] || exit 1

. /etc/vz/vz.conf
. $VE_CONFFILE

umount $VE_ROOT/home/phoenix/nginx-logs
exit 0


stopping VE:

root@nekobus:/etc/vz/conf# vzctl stop 1600
Stopping VE ...
VE was stopped
umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted
umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted
VE is unmounted


while umount complains, path is unmounted:
root@nekobus:/etc/vz/conf# mount|grep nginx|wc -l
0


If i comment out "exit 0" and try to stop VE, i see:

root@nekobus:/etc/vz/conf# vzctl stop phoenix
Stopping VE ...
VE was stopped
umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted
umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted
Error executing umount script /etc/vz/conf/1600.umount


unmounting in manual mode:

root@nekobus:/etc/vz/conf# vzctl umount 1600
umount: /var/lib/vz/root/1600/home/phoenix/nginx-logs: not mounted
Error executing umount script /etc/vz/conf/1600.umount


Hardware node is on Debian Sarge, kernel info:

root@nekobus:/etc/vz/conf# cat /proc/version
Linux version 2.6.18-028stab031 (root@nekobus) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #1 Fri May 4 01:55:17 MSD 2007

vzctl info:
root@nekobus:/etc/vz/conf# vzctl --version
vzctl version 3.0.16-1dso2~sarge0

[Updated on: Mon, 28 May 2007 11:42] by Moderator

Report message to a moderator

Re: strange mount/umount issues [message #12729 is a reply to message #12706] Tue, 08 May 2007 10:25 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello it's known issued. Use 'Search' at the forum and you'll find the answer Wink

Vasily.
Re: strange mount/umount issues [message #13450 is a reply to message #12729] Sun, 27 May 2007 10:45 Go to previous messageGo to next message
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
I have the same problem but I couldn't find a solution on the forum. Which post describes the solution for this issue?
Re: strange mount/umount issues [message #13453 is a reply to message #13450] Sun, 27 May 2007 11:23 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
OK, I can't find appropriate posts at the moment either! Wink So I explain the problem once again. The thing is that when you produce mount command on HN (e.g. from 101.mount script), the entry in /etc/mtab on HN appears. Later when VE stops all mount points in VE are umounted automatically even _without_ umount script. But the entry in /etc/mtab is still there! It makes mount a bit crazy...

So, you should use `mount -n` in mount script and don't use umount script at all.

HTH,
Vasily.
Re: strange mount/umount issues [message #13458 is a reply to message #13453] Sun, 27 May 2007 12:19 Go to previous message
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
Perfectly clear, thanks! I'll try asap.
Previous Topic: *SOLVED* Quota on HostNode
Next Topic: *SOLVED* Missing Module vzdev, though selected in kernel config
Goto Forum:
  


Current Time: Sat Nov 16 11:47:35 GMT 2024

Total time taken to generate the page: 0.03059 seconds