[[+content_image]]
A
A
Alexey Sundukov2013-02-23 23:08:37
linux
Alexey Sundukov, 2013-02-23 23:08:37

Enabling disk quotas on xfs?

I can't figure out why I can't enable disk quotas on xfs using this description: " Learning Linux, 101: Managing Disk Quotas ".
System:

[[email protected] ~]# uname -a
Linux 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Options for mounting with quotas enabled:
[[email protected] ~]# cat /etc/fstab
proc /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
/dev/md0 none swap sw 0 0
/dev/md1 /boot ext3 defaults 0 0
/dev/md2 / xfs defaults,usrquota,prjquota 0 0

... and as I understand it, it was even mounted:
[[email protected] ~]# mount
/dev/md2 on / type xfs (rw,usrquota,prjquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event)

I'm trying to enable a quota for a directory:
[[email protected] ~]# ls -l /quotatest/xfs/
total 0
drwxrwxrwx 2 u1 u1 6 Feb 23 14:47 proj-dir1/
drwxrwxrwx 2 u1 u1 6 Feb 23 14:47 proj-dir2/

Activate for the project:
[[email protected] ~]# cat /etc/projects
50:/quotatest/xfs/proj-dir1
[[email protected] ~]# cat /etc/projid
dev-projects:50
[[email protected] ~]# xfs_quota -x
xfs_quota> path
      Filesystem          Pathname
 000  /                   /dev/disk/by-uuid/44ec9386-66b3-4779-889d-c341fd67193b
[001] /quotatest/xfs/proj-dir1 /dev/disk/by-uuid/44ec9386-66b3-4779-889d-c341fd67193b (project 50, dev-projects)
xfs_quota> project -s dev-projects
Setting up project dev-projects (path /quotatest/xfs/proj-dir1)...
Processed 1 (/etc/projects and cmdline) paths for project dev-projects with recursion depth infinite (-1).
xfs_quota> limit -p bhard=15m dev-projects
xfs_quota: cannot set limits: Function not implemented
xfs_quota>

Why is that? In which direction to dig? I would be grateful for any idea.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexey Sundukov, 2013-02-26
@alekciy

Understood what was the matter. I'll post it for the future.
As I originally suspected, it was a quota limit for /. Enabling quotas for it via fstab just doesn't work. Therefore, you need to do this through the options to mount the root file system when booting through the rootflags flag. On debian, if the download goes through grub, then add / change /etc/default/grub (to enable project quotas):

GRUB_CMDLINE_LINUX="rootflags=prjquota"

then run update-grub (which will write it to /boot/grub/grub.cfg) and then reboot. Quotas on the root file system are available and you can set a project quota on any of its subdirectories.

3
3vi1_0n3, 2013-02-24
@3vi1_0n3

The first thing that came to mind.
Did you remount the filesystem after enabling quotas in /etc/fstab (mount /quotatest/xfs -o remount) or unmount it and then mount it (umount /quotatest/xfs && mount /quotatest/xfs)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question