<div dir="ltr">I do create two subdirectory for project<div><br></div><div>and the error maybe caused by this step:</div><div><div>xfs_quota -x -c 'project –c task1' /home/xiameng.xm/xfs_dir</div><div><br></div><div>–c - no such project in /etc/projects</div><div>Checking project task1 (path /home/xiameng.xm/xfs_dir/task1)...</div><div>/home/xiameng.xm/xfs_dir/task1 - project identifier is not set (inode=0, tree=11)</div><div>/home/xiameng.xm/xfs_dir/task1 - project inheritance flag is not set</div><div>Processed 1 /etc/projects paths for project task1</div></div><div><br></div><div>I'm a little confused about the output message, cause everything is ok in config file</div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-21 19:21 GMT+08:00 Brian Foster <span dir="ltr"><<a href="mailto:bfoster@redhat.com" target="_blank">bfoster@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Aug 21, 2015 at 05:05:00PM +0800, Simon Xia wrote:<br>
> hi, everyone, I encounter a problem when using xfs<br>
><br>
> now I have two tasks and I wanna run them in different directory and limit<br>
> the directory’s size. I use xfs’s project quota to achieve this.<br>
><br>
> I follow the steps from here:<br>
> <a href="https://solidlinux.wordpress.com/2012/12/09/xfs-quota-managament/" rel="noreferrer" target="_blank">https://solidlinux.wordpress.com/2012/12/09/xfs-quota-managament/</a><br>
><br>
> here is detail of my two config files<br>
><br>
> /etc/projects:<br>
><br>
> 11:/home/xiameng.xm/xfs_dir/task1<br>
> 12:/home/xiameng.xm/xfs_dir/task2<br>
><br>
> /etc/projid:<br>
><br>
> task1:11<br>
> task2:12<br>
><br>
> and here is my step:<br>
><br>
> touch test_xfs<br>
> dd if=/dev/zero of=test_xfs bs=1000000 count=1<br>
> mkfs.xfs test_xfs<br>
><br>
<br>
</span>That looks small, I can't even mkfs a file that small. I ran through<br>
this using 'bs=1M count=100.'<br>
<span class=""><br>
> mkdir xfs_dir<br>
> mount test_xfs ./xfs_dir -o pquota,loop<br>
><br>
> xfs_quota -xc 'project –s task1' /home/xiameng.xm/xfs_dir<br>
> xfs_quota -xc 'project –s task2' /home/xiameng.xm/xfs_dir<br>
><br>
<br>
</span>I don't see where you've created the directories yet..? I get the<br>
following:<br>
<br>
# xfs_quota -xc 'project -s task1' /mnt/<br>
xfs_quota: cannot find mount point for path `/mnt/task1': No such file or directory<br>
<br>
... until I create the task1/task2 directories. This is required because<br>
the project quota command has to set the project id on the directory<br>
inode. It won't work if the directory is created after this point,<br>
regardless of whether the quota limit is specified.<br>
<br>
Once I create those directories and run the project command, everything<br>
seems to work. I can write up to 2MB to task1 and 10MB to task2.<br>
<br>
Brian<br>
<span class=""><br>
> xfs_quota -x -c 'limit -p bhard=2m task1' /home/xiameng.xm/xfs_dir<br>
> xfs_quota -x -c 'limit -p bhard=10m task2' /home/xiameng.xm/xfs_dir<br>
><br>
> here is the output of xfs_quota -x -c 'report /home/xiameng.xm/xfs_dir'<br>
><br>
> Project quota on /home/xiameng.xm/xfs_dir (/dev/loop1)<br>
> Blocks<br>
> Project ID Used Soft Hard Warn/Grace<br>
> ---------- --------------------------------------------------<br>
> task1 0 0 2048 00 [--------]<br>
> task2 0 0 10240 00 [--------]<br>
><br>
> the question is no mater how large I create a file in ./xfs_dir/task1 or<br>
> ./xfs_dir/task2, it success!<br>
><br>
> the quota limit doesn’t work!<br>
><br>
> Any help will be appreciated :)<br>
><br>
><br>
> ps: I also post my question here:<br>
> <a href="http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work" rel="noreferrer" target="_blank">http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work</a><br>
><br>
> ----<br>
><br>
> Best Regards<br>
> Simon Xia<br>
> <br>
<br>
</span>> _______________________________________________<br>
> xfs mailing list<br>
> <a href="mailto:xfs@oss.sgi.com">xfs@oss.sgi.com</a><br>
> <a href="http://oss.sgi.com/mailman/listinfo/xfs" rel="noreferrer" target="_blank">http://oss.sgi.com/mailman/listinfo/xfs</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Best Regards<div><br></div><div>Simon Xia</div></div></div>
</div></div>