public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfs directory quota doesn't work
@ 2015-08-21  9:05 Simon Xia
  2015-08-21 11:21 ` Brian Foster
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Xia @ 2015-08-21  9:05 UTC (permalink / raw)
  To: xfs


[-- Attachment #1.1: Type: text/plain, Size: 1654 bytes --]

hi, everyone, I encounter a problem when using xfs

now I have two tasks and I wanna 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=1000000 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 success!

the quota limit doesn’t work!

Any help will be appreciated :)


ps: I also post my question here:
http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work

----

Best Regards
Simon Xia
​

[-- Attachment #1.2: Type: text/html, Size: 9449 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xfs directory quota doesn't work
  2015-08-21  9:05 xfs directory quota doesn't work Simon Xia
@ 2015-08-21 11:21 ` Brian Foster
  2015-08-24  6:43   ` Simon Xia
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Foster @ 2015-08-21 11:21 UTC (permalink / raw)
  To: Simon Xia; +Cc: xfs

On Fri, Aug 21, 2015 at 05:05:00PM +0800, Simon Xia wrote:
> hi, everyone, I encounter a problem when using xfs
> 
> now I have two tasks and I wanna 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=1000000 count=1
> mkfs.xfs test_xfs
> 

That looks small, I can't even mkfs a file that small. I ran through
this using 'bs=1M count=100.'

> 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
> 

I don't see where you've created the directories yet..? I get the
following:

# xfs_quota -xc 'project -s task1' /mnt/
xfs_quota: cannot find mount point for path `/mnt/task1': No such file or directory

... until I create the task1/task2 directories. This is required because
the project quota command has to set the project id on the directory
inode. It won't work if the directory is created after this point,
regardless of whether the quota limit is specified.

Once I create those directories and run the project command, everything
seems to work. I can write up to 2MB to task1 and 10MB to task2.

Brian

> 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 success!
> 
> the quota limit doesn’t work!
> 
> Any help will be appreciated :)
> 
> 
> ps: I also post my question here:
> http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work
> 
> ----
> 
> Best Regards
> Simon Xia
> ​

> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xfs directory quota doesn't work
  2015-08-21 11:21 ` Brian Foster
@ 2015-08-24  6:43   ` Simon Xia
  2015-08-24 12:02     ` Brian Foster
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Xia @ 2015-08-24  6:43 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs


[-- Attachment #1.1: Type: text/plain, Size: 3517 bytes --]

I do create two subdirectory for project

and the error maybe caused by this step:
xfs_quota -x -c 'project –c task1' /home/xiameng.xm/xfs_dir

–c - no such project in /etc/projects
Checking project task1 (path /home/xiameng.xm/xfs_dir/task1)...
/home/xiameng.xm/xfs_dir/task1 - project identifier is not set (inode=0,
tree=11)
/home/xiameng.xm/xfs_dir/task1 - project inheritance flag is not set
Processed 1 /etc/projects paths for project task1

I'm a little confused about the output message, cause everything is ok in
config file

2015-08-21 19:21 GMT+08:00 Brian Foster <bfoster@redhat.com>:

> On Fri, Aug 21, 2015 at 05:05:00PM +0800, Simon Xia wrote:
> > hi, everyone, I encounter a problem when using xfs
> >
> > now I have two tasks and I wanna 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=1000000 count=1
> > mkfs.xfs test_xfs
> >
>
> That looks small, I can't even mkfs a file that small. I ran through
> this using 'bs=1M count=100.'
>
> > 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
> >
>
> I don't see where you've created the directories yet..? I get the
> following:
>
> # xfs_quota -xc 'project -s task1' /mnt/
> xfs_quota: cannot find mount point for path `/mnt/task1': No such file or
> directory
>
> ... until I create the task1/task2 directories. This is required because
> the project quota command has to set the project id on the directory
> inode. It won't work if the directory is created after this point,
> regardless of whether the quota limit is specified.
>
> Once I create those directories and run the project command, everything
> seems to work. I can write up to 2MB to task1 and 10MB to task2.
>
> Brian
>
> > 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 success!
> >
> > the quota limit doesn’t work!
> >
> > Any help will be appreciated :)
> >
> >
> > ps: I also post my question here:
> >
> http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work
> >
> > ----
> >
> > Best Regards
> > Simon Xia
> > ​
>
> > _______________________________________________
> > xfs mailing list
> > xfs@oss.sgi.com
> > http://oss.sgi.com/mailman/listinfo/xfs
>
>


-- 
Best Regards

Simon Xia

[-- Attachment #1.2: Type: text/html, Size: 4985 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xfs directory quota doesn't work
  2015-08-24  6:43   ` Simon Xia
@ 2015-08-24 12:02     ` Brian Foster
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Foster @ 2015-08-24 12:02 UTC (permalink / raw)
  To: Simon Xia; +Cc: xfs

On Mon, Aug 24, 2015 at 02:43:07PM +0800, Simon Xia wrote:
> I do create two subdirectory for project
> 

Please try not to top-post...

> and the error maybe caused by this step:
> xfs_quota -x -c 'project –c task1' /home/xiameng.xm/xfs_dir
			   ^
That looks like an invalid character in the command here (and those
below). I probably didn't notice it before and just fixed up my local
commands...

> 
> –c - no such project in /etc/projects

... but this suggests it's not being interpreted as a command flag.
E.g., a command with the wrong character:

# xfs_quota -x -c 'project –c task1' /mnt
–c - no such project in /etc/projects or invalid project number
Checking project task1 (path /mnt/task1)...
/mnt/task1 - project identifier is not set (inode=0, tree=11)
/mnt/task1 - project inheritance flag is not set
Processed 1 (/etc/projects and cmdline) paths for project task1 with recursion depth infinite (-1).

vs. with the correct:

# xfs_quota -x -c 'project -c task1' /mnt
Checking project task1 (path /mnt/task1)...
/mnt/task1 - project identifier is not set (inode=0, tree=11)
/mnt/task1 - project inheritance flag is not set
Processed 1 (/etc/projects and cmdline) paths for project task1 with recursion depth infinite (-1).

All in all, you should see something like the following from the '-s'
command before this is expected to work:

# xfs_quota -xc 'project -s task1' /mnt
Setting up project task1 (path /mnt/task1)...
Processed 1 (/etc/projects and cmdline) paths for project task1 with recursion depth infinite (-1).

And for further verification, the project ID should be set on the
associated directory:

# xfs_io -c "lsproj" /mnt/task1
projid = 11

Brian

> Checking project task1 (path /home/xiameng.xm/xfs_dir/task1)...
> /home/xiameng.xm/xfs_dir/task1 - project identifier is not set (inode=0,
> tree=11)
> /home/xiameng.xm/xfs_dir/task1 - project inheritance flag is not set
> Processed 1 /etc/projects paths for project task1
> 
> I'm a little confused about the output message, cause everything is ok in
> config file
> 
> 2015-08-21 19:21 GMT+08:00 Brian Foster <bfoster@redhat.com>:
> 
> > On Fri, Aug 21, 2015 at 05:05:00PM +0800, Simon Xia wrote:
> > > hi, everyone, I encounter a problem when using xfs
> > >
> > > now I have two tasks and I wanna 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=1000000 count=1
> > > mkfs.xfs test_xfs
> > >
> >
> > That looks small, I can't even mkfs a file that small. I ran through
> > this using 'bs=1M count=100.'
> >
> > > 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
> > >
> >
> > I don't see where you've created the directories yet..? I get the
> > following:
> >
> > # xfs_quota -xc 'project -s task1' /mnt/
> > xfs_quota: cannot find mount point for path `/mnt/task1': No such file or
> > directory
> >
> > ... until I create the task1/task2 directories. This is required because
> > the project quota command has to set the project id on the directory
> > inode. It won't work if the directory is created after this point,
> > regardless of whether the quota limit is specified.
> >
> > Once I create those directories and run the project command, everything
> > seems to work. I can write up to 2MB to task1 and 10MB to task2.
> >
> > Brian
> >
> > > 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 success!
> > >
> > > the quota limit doesn’t work!
> > >
> > > Any help will be appreciated :)
> > >
> > >
> > > ps: I also post my question here:
> > >
> > http://unix.stackexchange.com/questions/224606/xfs-directory-quota-doesnt-work
> > >
> > > ----
> > >
> > > Best Regards
> > > Simon Xia
> > > ​
> >
> > > _______________________________________________
> > > xfs mailing list
> > > xfs@oss.sgi.com
> > > http://oss.sgi.com/mailman/listinfo/xfs
> >
> >
> 
> 
> -- 
> Best Regards
> 
> Simon Xia

> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-24 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-21  9:05 xfs directory quota doesn't work Simon Xia
2015-08-21 11:21 ` Brian Foster
2015-08-24  6:43   ` Simon Xia
2015-08-24 12:02     ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox