Difference between revisions of "XFS"

From Linux-VServer

Jump to: navigation, search
Line 6: Line 6:
 
Let's say we want to limit /vserver/foo to 5G of space.
 
Let's say we want to limit /vserver/foo to 5G of space.
  
1. Edit /etc/fstab, and put prjquota as an option for /vserver, and reboot. (I don't think -o remount works)
+
Edit /etc/fstab, and put prjquota as an option for /vserver, and reboot. (I don't think -o remount works). It should look like this:
2. echo "1235:/vservers/foo" >> /etc/projects (I use the context for the project ID number)
+
<pre># grep prjquota /etc/fstab
3. echo "foo:1235" >> /etc/projid (This is just so you can refer to a project by name)
+
/dev/cciss/c0d0p7      /vserver          xfs    noatime,prjquota        0 0
 +
host1 ~ #
 +
</pre>
 +
<pre>echo "1235:/vservers/foo" >> /etc/projects</pre>(I use the context for the project ID number)
 +
<pre>echo "foo:1235" >> /etc/projid</pre>(This is just so you can refer to a project by name)
  
 
Now we just set up the quota....
 
Now we just set up the quota....

Revision as of 13:37, 3 October 2007

So, you use the lovely XFS file system, but those meanies at linux-vserver have told you it's not supported. :) No problems.

To get the same sort of effect as dlimits, while using the XFS file system, you can use Project Quotas.

Let's say we want to limit /vserver/foo to 5G of space.

Edit /etc/fstab, and put prjquota as an option for /vserver, and reboot. (I don't think -o remount works). It should look like this:

# grep prjquota /etc/fstab
/dev/cciss/c0d0p7       /vserver           xfs     noatime,prjquota        0 0
host1 ~ #
echo "1235:/vservers/foo" >> /etc/projects
(I use the context for the project ID number)
echo "foo:1235" >> /etc/projid
(This is just so you can refer to a project by name)

Now we just set up the quota....

xfs_quota -x -c 'project -s foo' /vserver

And set our limits on it.

xfs_quota -x -c 'limit -p bhard=5G foo' /vserver

Voila. Vservers with XFS.

You can check the usage, etc with:

# xfs_quota -x -c 'report' /home
Project quota on /home (/dev/cciss/c0d0p7)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
foo           3002840          0    5242880    00 [--------]
....

It does work, but df -h doesn't show the limit in the vserver. I'm not sure how users are meant to see how close they are to the limit. I shall investigate, and if I work it out, come back here.

Personal tools