0

I have two tasks and I want to run them in different directory and limit the directory's size. I use xfs's project quota to achieve this.

I follow the steps from here:https://solidlinux.wordpress.com/2012/12/09/xfs-quota-managament/

here is detail of my two config files

/etc/projects:

11:/home/xiameng.xm/xfs_dir/task1
12:/home/xiameng.xm/xfs_dir/task2

/etc/projid:

task1:11
task2:12

and here is my step:

touch test_xfs
dd if=/dev/zero of=test_xfs bs=100M count=1
mkfs.xfs test_xfs

mkdir xfs_dir
mount test_xfs ./xfs_dir -o pquota,loop

xfs_quota -xc 'project –s task1' /home/xiameng.xm/xfs_dir
xfs_quota -xc 'project –s task2' /home/xiameng.xm/xfs_dir

xfs_quota -x -c 'limit -p bhard=2m task1' /home/xiameng.xm/xfs_dir
xfs_quota -x -c 'limit -p bhard=10m task2' /home/xiameng.xm/xfs_dir

here is the output of xfs_quota -x -c 'report /home/xiameng.xm/xfs_dir'

Project quota on /home/xiameng.xm/xfs_dir (/dev/loop1)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
task1               0          0       2048     00 [--------]
task2               0          0      10240     00 [--------]

the question is no mater how large I create a file in ./xfs_dir/task1 or ./xfs_dir/task2, it succeeds!

The quota limit doesn't work!

  • If I understand your commands correctly, you set quotas of 2 megabytes and 10 megabytes on a filesystem with a capacity of only 1 megabyte. How large are the files that you are able to create in the filesystem? – Mark Plotnick Aug 21 '15 at 9:05
  • @MarkPlotnick but no matter how large the file in ./task1 , the used is always 0 – simon_xia Aug 21 '15 at 9:13
0

We ran into the identical issue. The problem was that we failed to initialize the mount point with the project using:

xfs_quota -x -c 'project -s yourProjectName' yourMountPoint

As soon as we did this, the xfs_quota report successfully reported the Used space under the project path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.