Difference between revisions of "Standard non-shared quota"

From Linux-VServer

Jump to: navigation, search
(Migrated from http://oldwiki.linux-vserver.org/Standard+non-shared+quota)
 
m (Cleaned up article)
Line 1: Line 1:
Want to enable quotas from within a vserver, nothing special, just plain old and good quota support? Then this might help you! :)
+
Want to enable quotas from within a vserver, nothing special, just plain old and good quota support? Then this might help you!  
 +
First things first, you will need a vserver enabled kernel that you have made working and you need to add vroot support to it (In menuconfig it is in Device Drivers → Block Devices → Virtual Root device support).
  
First things first, you will need a vserver enabled kernel that you have made working and you need to add vroot support to it (In menuconfig it is in Device Drivers, Block Devices, Virtual Root device support).
+
After booting on the vroot enabled vserver kernel, you should have a directory '''/dev/vroot/''' with 8 vroot devices (0-7) you can use to set up your quota, if you don't, then you may make them by mknod /dev/vroot/n b 4 n (where n can be from 0 to 7). If your Linux distribution uses ''udev'', these will be at '''/dev/vroot[0-7]''' instead.
 
+
After booting on the vroot enabled vserver kernel, you should have a directory '''/dev/vroot/''' with 8 vroot devices (0-7) you can use to set up your quota, if you don't, then you may make them by mknod /dev/vroot/n b 4 n (where n can be from 0 to 7).
+
 
+
If your distro uses ''udev'', the vroot devices will be called:
+
 
+
'''/dev/vroot[0-7]'''
+
  
 
Use ''vrsetup'' to tell the kernel what block device you want to handle quota for:
 
Use ''vrsetup'' to tell the kernel what block device you want to handle quota for:
Line 13: Line 8:
 
or
 
or
 
  vrsetup /dev/vroot/0 /dev/lvm/vserver0
 
  vrsetup /dev/vroot/0 /dev/lvm/vserver0
 +
or
 +
vrsetup /dev/vroot/0 /dev/hda5
 +
Depending on what partitioning scheme you're using.
  
 
Setting up the vserver for quota is straight forward: (you need util-vserver 30.208 or newer)
 
Setting up the vserver for quota is straight forward: (you need util-vserver 30.208 or newer)
 
+
1. Create a default mtab for the guest. To do this, add:
- Step1: Create a default mtab for the guest:
+
Add
+
 
  /dev/hdv1 / ufs rw,usrquota,grpquota 0 0
 
  /dev/hdv1 / ufs rw,usrquota,grpquota 0 0
 
to '''/etc/vservers/<name>/apps/init/mtab'''
 
to '''/etc/vservers/<name>/apps/init/mtab'''
  
- Step2: Add the quota capability to the guest vserver:
+
2. Add the quota capability to the guest vserver. Add:
 
+
Add
+
 
  quota_ctl  
 
  quota_ctl  
 
to '''/etc/vservers/<name>/ccapabilities'''
 
to '''/etc/vservers/<name>/ccapabilities'''
  
Now you need to copy the vroot device which we setup earlier, to the vserver:
+
3. Copy the vroot device which we setup earlier to the vserver:
 
  cp -af /dev/vroot/0 /vservers/<name>/dev/hdv1
 
  cp -af /dev/vroot/0 /vservers/<name>/dev/hdv1
  
Finishing the setup:
 
  
- start your guest
+
Finishing the setup:
  
- inside the guest run:
+
1. Start your guest.
 +
2. Inside the guest, run:
 
  quotacheck -maugv
 
  quotacheck -maugv
  
- still inside the guest, turn quotas on
+
3. Still inside the guest, turn quotas on.
  
 
DONE!
 
DONE!

Revision as of 07:20, 25 July 2007

Want to enable quotas from within a vserver, nothing special, just plain old and good quota support? Then this might help you! First things first, you will need a vserver enabled kernel that you have made working and you need to add vroot support to it (In menuconfig it is in Device Drivers → Block Devices → Virtual Root device support).

After booting on the vroot enabled vserver kernel, you should have a directory /dev/vroot/ with 8 vroot devices (0-7) you can use to set up your quota, if you don't, then you may make them by mknod /dev/vroot/n b 4 n (where n can be from 0 to 7). If your Linux distribution uses udev, these will be at /dev/vroot[0-7] instead.

Use vrsetup to tell the kernel what block device you want to handle quota for:

vrsetup /dev/vroot/0 /dev/evms/vs

or

vrsetup /dev/vroot/0 /dev/lvm/vserver0

or

vrsetup /dev/vroot/0 /dev/hda5

Depending on what partitioning scheme you're using.

Setting up the vserver for quota is straight forward: (you need util-vserver 30.208 or newer) 1. Create a default mtab for the guest. To do this, add:

/dev/hdv1 / ufs rw,usrquota,grpquota 0 0

to /etc/vservers/<name>/apps/init/mtab

2. Add the quota capability to the guest vserver. Add:

quota_ctl 

to /etc/vservers/<name>/ccapabilities

3. Copy the vroot device which we setup earlier to the vserver:

cp -af /dev/vroot/0 /vservers/<name>/dev/hdv1


Finishing the setup:

1. Start your guest. 2. Inside the guest, run:

quotacheck -maugv

3. Still inside the guest, turn quotas on.

DONE!

Personal tools