Menu
Debian “wheezy” Release Information. The release included many major changes, described in our press release and the Release Notes. Debian 7 has been superseded by Debian 8 (jessie). Wheezy also benefits from Long Term Support (LTS) until the end of May 2018. The LTS is limited to i386, amd64, armel and armhf. For more information, please refer to the LTS section of the Debian Wiki.
I'm trying to get userquotas working on a xfs-formatted root partition.
However, I can't mount the partition with userquota enabled:
I tried remounting with
mount -o remount,uquota /
and rebooting. The mount command didn't output anything.I also tried using
usrquota
instead of uquota
, but that made no difference.Does anyone has an idea how to solve that?
EDIT: Here is what happens when I try to remount
/
, for clearness:Fanir
FanirFanir
1 Answer
Looks like it's not mounted with quotas turned on. According to the xfs_quota man page setting quotas on root filesystems requires a different approach than other XFS filesystems. From the 'QUOTA ADMINISTRATION' section of man xfs_quota:
'Turning on quotas on the root filesystem is slightly different from the above. For IRIX XFS, refer to quotaon(1M). For Linux XFS, the quota mount flags must be passed in with the 'rootflags=' boot parameter.'
Setting GRUB_CMDLINE_LINUX='rootflags=quota' in /etc/default/grub, running update-grub, and rebooting should enable quotas on the root filesystem.
SteveSteve
Not the answer you're looking for? Browse other questions tagged debianmountdebian-wheezyquotaxfs or ask your own question.
On Linux, you can setup disk quota using one of the following methods:
- File system base disk quota allocation
- User or group based disk quota allocation
On the user or group based quota, following are three important factors to consider:
- Hard limit – For example, if you specify 2GB as hard limit, user will not be able to create new files after 2GB
- Soft limit – For example, if you specify 1GB as soft limit, user will get a warning message “disk quota exceeded”, once they reach 1GB limit. But, they’ll still be able to create new files until they reach the hard limit
- Grace Period – For example, if you specify 10 days as a grace period, after user reach their hard limit, they would be allowed additional 10 days to create new files. In that time period, they should try to get back to the quota limit.
1. Enable quota check on filesystem
First, you should specify which filesystem are allowed for quota check.
Modify the /etc/fstab, and add the keyword usrquota and grpquota to the corresponding filesystem that you would like to monitor.
The following example indicates that both user and group quota check is enabled on /home filesystem
Reboot the server after the above change.
2. Initial quota check on Linux filesystem using quotacheck
Once you’ve enabled disk quota check on the filesystem, collect all quota information initially as shown below.
In the above command:
- a: Check all quota-enabled filesystem
- v: Verbose mode
- u: Check for user disk quota
- g: Check for group disk quota
The above command will create a aquota file for user and group under the filesystem directory as shown below.
3. Assign disk quota to a user using edquota command
Use the edquota command as shown below, to edit the quota information for a specific user.
For example, to change the disk quota for user ‘ramesh’, use edquota command, which will open the soft, hard limit values in an editor as shown below.
Once the edquota command opens the quota settings for the specific user in a editor, you can set the following limits:
- soft and hard limit for disk quota size for the particular user.
- soft and hard limit for the total number of inodes that are allowed for the particular user.
4. Report the disk quota usage for users and group using repquota
Use the repquota command as shown below to report the disk quota usage for the users and groups.
5. Add quotacheck to daily cron job
Add the quotacheck to the daily cron job. Create a quotacheck file as shown below under the /etc/cron.daily directory, that will run the quotacheck command everyday. This will send the output of the quotacheck command to root email address.
> Add your comment