3

Is it possible to use disk quota inside a LXC container?

I'm using LVM (ext4) as rootfs for the container. I don't now how to add the mount options to /etc/fstab properly.

The /etc/fstab of the container:

rootfs / rootfs rw,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 0

This is what quotacheck -cug / returns:

quotacheck: Mountpoint (or device) / not found or has no quota enabled. quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

Output of mount:

http://pastebin.com/33AF62pu

  • care to elaborate a bit adding, for example, what have you tried so far, how did it fail, etc...? – dawud Aug 3 '13 at 11:12
2

Assuming your root file system is formatted in a file system with quota support, like ext3 or ext4, add usrquota,grpquota to /etc/fstab entry under options section (fourth field), and then run (assuming / is the file system mount point)

mount -o remount /

This assumes there is a separate file system for each LXC instance, else all instances sharing the same file system will be affected.

Make sure that the quota program is installed (how this is done varies depending on your OS version)

  • I've added more details in question. mount: cannot remount block device rootfs read-write, is write-protected Maybe AppArmor? – CiTuX Aug 3 '13 at 14:12
  • did you run # quotacheck -cug / ? I'm not too familiar with AppArmor, but it could be the culprit check the logs – Petter H Aug 4 '13 at 5:23

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.