Difference between revisions of "XFS"
From Linux-VServer
(+cat) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
<pre># grep prjquota /etc/fstab | <pre># grep prjquota /etc/fstab | ||
/dev/cciss/c0d0p7 /vserver xfs noatime,prjquota 0 0 | /dev/cciss/c0d0p7 /vserver xfs noatime,prjquota 0 0 | ||
− | |||
</pre> | </pre> | ||
+ | |||
+ | Warning: XFS: cannot mount with both project and group quota | ||
+ | |||
<pre>echo "1235:/vservers/foo" >> /etc/projects</pre>(I use the context for the project ID number) | <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) | <pre>echo "foo:1235" >> /etc/projid</pre>(This is just so you can refer to a project by name) | ||
Line 18: | Line 20: | ||
<pre>xfs_quota -x -c 'project -s foo' /vserver</pre> | <pre>xfs_quota -x -c 'project -s foo' /vserver</pre> | ||
− | And set our limits on it. | + | And set our limits on it. (bhard = blocks hard, bsoft = blocks soft) |
− | <pre>xfs_quota -x -c 'limit -p bhard=5G foo' /vserver</pre> | + | <pre>xfs_quota -x -c 'limit -p bsoft=4800M bhard=5G foo' /vserver</pre> |
Voila. Vservers with XFS. | Voila. Vservers with XFS. | ||
Line 26: | Line 28: | ||
You can check the usage, etc with: | You can check the usage, etc with: | ||
− | <pre> | + | <pre># xfs_quota -x -c 'report' /vserver |
− | # xfs_quota -x -c 'report' / | + | Project quota on /vserver (/dev/cciss/c0d0p7) |
− | Project quota on / | + | |
Blocks | Blocks | ||
Project ID Used Soft Hard Warn/Grace | Project ID Used Soft Hard Warn/Grace | ||
---------- -------------------------------------------------- | ---------- -------------------------------------------------- | ||
− | foo | + | foo 10002856 4915200 5242880 00 [--none--] |
.... | .... | ||
</pre> | </pre> | ||
− | It does work, but df -h doesn't show the limit in the vserver. | + | It does work, but df -h doesn't show the limit properly in the vserver. |
+ | It does show the size, and the used, but the avail it still takes from the | ||
+ | <pre># df -h | ||
+ | Filesystem Size Used Avail Use% Mounted on | ||
+ | /dev/hdv1 5.0G 3.0G 17G 21% / | ||
+ | </pre> | ||
+ | |||
+ | [[Category:Documentation]] |
Latest revision as of 20:03, 21 October 2011
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
Warning: XFS: cannot mount with both project and group quota
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. (bhard = blocks hard, bsoft = blocks soft)
xfs_quota -x -c 'limit -p bsoft=4800M bhard=5G foo' /vserver
Voila. Vservers with XFS.
You can check the usage, etc with:
# xfs_quota -x -c 'report' /vserver Project quota on /vserver (/dev/cciss/c0d0p7) Blocks Project ID Used Soft Hard Warn/Grace ---------- -------------------------------------------------- foo 10002856 4915200 5242880 00 [--none--] ....
It does work, but df -h doesn't show the limit properly in the vserver. It does show the size, and the used, but the avail it still takes from the
# df -h Filesystem Size Used Avail Use% Mounted on /dev/hdv1 5.0G 3.0G 17G 21% /