From: Nuno Silva (nuno.silva_at_vgertech.com)
Date: Thu 08 May 2003 - 11:05:48 BST
Mitchell Smith wrote:
> I am wondering if it is possible to enforce a disk quota on a virtual
Don't use a partition in a block device as the vserver's root. Use a
/dev/loop and mount it prior to starting the vserver.
# mount -o loop /vserver-images/vserver1.img /vservers/vserver1
# vserver vserver1 start
If you need to add 1GB to it:
# vserver vserver1 stop
# umount /vservers/vserver1
# dd if=/dev/zero of=/tmp/1GB bs=1M count=1000
# cat /tmp/1GB >> /vserver-images/vserver1.img
# resize2fs /vserver-images/vserver1.img
> i.e. if I had /home/vservers as a 40 gb partition and I want to split it up
> between 4 vservers at 10 gb each, can I tell each vserver that it can only
> use 10 gb of that partition?
> I know I could just partition up the drive that way, but then it doesn't
> allow for resizing any of the vservers disk space, say I wanted to give one
> 25 gb and shrink the other 3 down to 5 gb, I couldn't do that with out some
> major repartitioning.
> Comments very welcome.
> From Mitchell