# enabling quotas with XFS [SOLVED]

## apryan

Hi,

I'm having problems getting quotas to work properly under the XFS file system. I followed the directions at http://www.gentoo.org/doc/en/gentoo-security.xml#doc_chap6_sect3

and found that after added the usrquotas option to fstab, the hard drive fails to mount.

/dev/sda3 / xfs noatime,usrquota 0 0

ls -s /

-rw------- 1 root root 0 Feb 2 07:43 aquota.group

-rw------- 1 root root 0 Feb 2 07:43 aquota.user

...

Quota support is checked in the kernel in the XFS section and in the main section (I'm guessing both needed to be checked?). Plus we have old and v2 checked as well. Kernel was rebuilt and quota was emerged and rc'd.

Any ideas why quotas would stop the hard drive from mounting?

We're running 2.6.10-gentoo-r6 on AMD64 platform. XFS for /.

thanksLast edited by apryan on Fri Feb 04, 2005 4:22 pm; edited 1 time in total

----------

## apryan

I did some nifty research and discovered this...

http://oss.sgi.com/bugzilla/show_bug.cgi?id=236

 *Quote:*   

> 
> 
> I was able to solve this by passing more info. to the kernel
> 
> during boot.  This is the line I used in my lilo.conf file:
> ...

 

Those people were using lilo which is masked on amd64. I was running grub on my system. So what I wound up doing was adding 

```
rootflags=usrquota,grpquota ro
```

to the end of my kernel line in /boot/grub/grub.conf. I rebooted and now quotas works on XFS!

Hope this helps someone else that may have had the same problem.

-anthony

----------

## mieses

Someone has posted very complete instructions XFS quotas in Gentoo:

Utilizing Quotas on XFS https://mi80.com/trackback/105

These instructions suggest to use rootflags=quota in grub.conf instead of rootflags=usrquota,grpquota, possibly equivalent expressions?

Neither variation works for me, however.

The boot process freezes with the following error:

 *Quote:*   

> * Remounting root filesystem read/write...
> 
> * Root filesystem could not be mounted read/write:(
> 
> Give root password for maintenance
> ...

 

After typing Ctrl-D,  the boot process continues but quota support is not enabled.

```
grub.conf

---------

kernel /kernel-genkernel-x86-2.6.15-gentoo-r1 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev doscsi rootflags=quota
```

```
fstab

-----

/dev/sda1               /boot           ext2            noauto,noatime          1 2

### Results in boot error: ###

#/dev/sda3              /               xfs             noatime,usrquota,grpquota       0 1

### No boot errors: ###

/dev/sda3               /               xfs             noatime                 0 1

/dev/sda2               none            swap            sw                      0 0

/dev/cdroms/cdrom0      /mnt/cdrom      auto            noauto,ro,user          0 0

none                    /proc           proc            defaults                0 0

none                    /dev/shm        tmpfs           defaults                0 0

/var/www/foo/htdocs    /home/www/foo/htdocs    none    rw,bind
```

The boot error goes away when ",usrquota,grpquota" is removed from fstab.

Is there a mistake in fstab?  I'm starting to get stuck..Last edited by mieses on Tue Mar 14, 2006 4:31 am; edited 1 time in total

----------

## apryan

Don't add it into fstab. Add it into Grub instead so that on boot it will enable quota.

```

title=Gentoo kernel-2.6.13-gentoo-r2

root (hd0,0)

kernel /kernel-2.6.13-gentoo-r2 root=/dev/sda3 idebus=66 rootflags=usrquota,grpquota ro

```

-anth

----------

## mieses

thanks.  i will try it again with 'rootflags=usrquota,grpquota ro' in grub.conf.

the partition still needs to be listed in fstab, but without the quota flags?  or should the partition not be listed in fstab at all?

----------

## thehailo

Interesting to see how it was solved in this thread. I figured it was worth mentioning I recently made a little how-to on the subject which takes a similar but slightly different approach (I found my solution in the XFS mailing list archive).

https://mi80.com/node/105

EDIT: Just noted someone linked to my how-to above, sorry for the repeat, didn't catch that earlier. Cool though, I'm flattered. After spending awhile and borking my first few attempts to get quotas working on XFS I was starting to wonder if anyone else cared about the topic.

Also about your continued problems, perhaps it has something to do with your numerous flags? For example I try to keep my grub.conf clean and simple, my entire kernel line is:

```
kernel /boot/kernel-2.6.14-hardened-r5 root=/dev/hda4 rootflags=quota
```

----------

## mieses

thehailo - thanks for writing your howto!

all of the instructions make sense, including the grub.conf entries.

but I still do not understand why bootup freezes when fstab contains usrquota and grpquota flags.

The linux-xfs mailing list mentions that quota options in fstab may have no effect:

http://oss.sgi.com/archives/linux-xfs/2004-09/msg00156.html

If fstab quota options have no effect on XFS quotas,  and if these options cause some people's bootups to freeze,  then it may be best to warn users to not use them.   I will get back with more info when I've tested a few more cases..

----------

