[Users] Split VE disk space between / and /var?

Kirill Korotaev dev at sw.ru
Thu Jan 31 01:42:03 EST 2008



Jan Tomasek wrote:
> Kirill Korotaev wrote:
>> it's possible to do the following:
>> - create some directory, say /vz/private/ID.2
>> - turn on vzquota on this directory (quota ID maybe VEID+some bug number, say 1000000)
>> - bind (u)mount /vz/private/ID.2 to /vz/root/ID/var in VE.(u)mount scripts.
> 
> That is quite interesting thanks! But I need bit more help.
> 
> Start of VE is fine:
> 
> chlivek:~# vzctl start 192003
> Starting VE ...
> + mount --bind /staj/vz/private/192003.mnt /staj/vz/root/192003/mnt
> VE is mounted
> Adding IP address(es): 192.168.0.3
> Setting CPU units: 1000
> Configure meminfo: 65536
> Set hostname: dns
> VE start in progress...
> 
> But stop not:
> 
> chlivek:~# vzctl enter 192003
> entered into VE 192003
> root at dns:/# ls /mnt
> big  x  xx
> 
> chlivek:~# vzctl stop 192003
> Stopping VE ...
> VE was stopped
> + ls -l /staj/vz/root/192003/mnt
> total 0
> + umount /staj/vz/root/192003/mnt
> umount: /staj/vz/private/192003.mnt: not mounted
> umount: /staj/vz/private/192003.mnt: not mounted

that's because VE distro specific init scripts do umount of everything on stop.
so you can ignore this warning (but leave umount just in case).

> + exit 0
> VE is unmounted
> 
> Mount point /staj/vz/root/192003/mnt doesn't exist at moment of calling.
> But when I do not call umout it hangs in system mount tab.

check -n option to mount.

> 
> I'm also interested if it's posible to have inside VE df showing correct
> info, instead of total HW node capacity.
> 
> root at dns:/# df -h
> Filesystem            Size  Used Avail Use% Mounted on
> simfs                 1.0G  370M  655M  37% /
> /dev2/root2           1.1T   46G 1020G   5% /mnt
> tmpfs                 4.0G     0  4.0G   0% /lib/init/rw
> tmpfs                 4.0G     0  4.0G   0% /dev/shm

have you called vzquota on on this directory?
plz check vzquota init, on, off commands.
you will need to assign some numerical ID to this quota directory (should be different from VEID),
setup vzquota on it and simply turn it on before bind mount.

Kirill



More information about the Users mailing list