Score:0

Set different Grace Period for Soft Limits for each user on Linux

bs flag

I have a problem with setting different grace period for each user

My setup:

1.Virtualbox 6.1

2.Fedora workstation 35

3.Extra partition created with fdisk utility for lab purposes.

Filesystem: ext4

Partition type: Linux

Partition size 2G

[root@fedora /]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda      8:0    0   20G  0 disk 
├─sda1   8:1    0  1.5G  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
├─sda3   8:3    0   10G  0 part /home
│                               /
└─sda4   8:4    0    2G  0 part /sda4
zram0  252:0    0  2.9G  0 disk [SWAP]
[root@fedora /]# 

4.Partition is formated with the following command mkfs –t ext4 /dev/sda4

5.The following line was added to the bottom of /etc/fstab file

/dev/sda4    /sda4     ext4   defaults,usrquota,grpquota  0  0

6.Machine was rebooted

7.I run the following commands to set up quotas:

Create the quota files with quotacheck -cug /sda4

Generate the table of current disk usage per file system with quotacheck -avug

8.Next I configured quota policies

[root@fedora /]# edquota user1

Disk quotas for user user1 (uid 1001):
  Filesystem           blocks       soft       hard     inodes     soft     hard
  /dev/sda4                 0       10000      20000         0        5        10

11.I tried to configure grace period for user1 and this is where the problem starts.

[root@fedora /]# edquota -T user1

Times to enforce softlimit for user user1 (uid 1001):
Time units may be: days, hours, minutes, or seconds
  Filesystem                         block grace               inode grace
  /dev/sda4                           3minutes                    unset

12.After the file configuration,I enabled the quota on with the following command quotaon /sda4

As soon as I setup grace period for user1,the countdown for soft quota kicks off right away as I close the configuration file.I am unable to set different grace period for each user

The only command that works is edquota -t to set default grace period for all users

[root@fedora /]# edquota -t


Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
  Filesystem             Block grace period     Inode grace period
  /dev/sda4                     7days                  7days

The question is:

How to set different Grace Period for Soft Limits for each user

I tried to

Enable quotas on file system creation mkfs.ext4 -O quota /dev/sda4

Enable quota feature on existing file systems tune2fs -O quota /dev/sda4

I followed every single step for quota configuration as suggested on Redhat website as well as other websites

Neither of this worked

Romeo Ninov avatar
in flag
From what I see you set 5MB as soft limit, but only 5 inodes which is very low value. Have you try to set more reasonable values?
Damian avatar
bs flag
Yes I tried with different values,I have the same problem.After I use edquota user1 -T and set up grace period for the user1.After I close the file and wrtie changes,the value changes to seconds and the countdown for soft quota kicks off staright away.
Damian avatar
bs flag
When I try to change the value when quota is on the value remains unchanged and is set to unset although the change was made and saved before exiting the configuration file When I turn quota off on file system with quotaoff /sda ,after I set grace period for example 5 minutes and save the file and exit,the value change to seconds and the countdown for soft quota kicks off straight away
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.