[CentOS] xfs quota question

Thu Aug 9 21:57:06 UTC 2018
Valeri Galtsev <galtsev at kicp.uchicago.edu>

On Thu, August 9, 2018 4:24 pm, mark wrote:
> Valeri Galtsev wrote:
>> On 08/09/18 14:57, mark wrote:
>>
>>> Can I go to an existing xfs file system, and apply a soft quota to each
>>>  user on it? If I do, can I then run a report, and see who's using how
>>> much, or does it only apply to files created after the quotas are
>>> applied?
>>
>> After remounting XFS filesystem with option "usrquota" you can issue the
>> command similar to:
>>
>> xfs_quota -x -c "limit bsoft=8g bhard=10g -d" /home
>>
>> This command will enable the limits above for all users (-d flag),
>> except users who have their limits existing already (usually ones who
>> preformed fs operations).
>>
>> For those who already have some limits set you can still can change
>> these limits, but with individual command, say in the loop, like:
>>
>> for i in `cat user_list`; \ do xfs_quota -x -c "limit bsoft=8g bhard=10g
>> $i; \
>> done
>>
>> I hope, this helps.
>
> Will that work if I do a mount -o remount?

If you are able to execute

mount -o remount -o usrquota /mountpoint

then you are OK. Normally, you will not be able to do it if there is even
a single file open on the filesystem, Therefore if it is /home you do have
to kick all users off. Executing any command related to quota will make it
obvious if particular filesystem is mounted with quotas enabled or not.

Good luck.

Valeri

>
>     mark



++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++