Archive for the ‘Quota’ Category

After a drive failure on one of our servers, I had to remake the quota info. Here’s what I did:

[root@serv1 home]# touch /local/home/aquota.user
[root@serv1 home]# chmod 600 /local/home/aquota.user
[root@cppc home]# quotacheck -vgum /local/home
quotacheck: WARNING -  Quotafile /local/home/aquota.user was probably truncated. Can't save quota settings...
quotacheck: Scanning /dev/sda1 [/local/home] |

Now I could just reset all the user quotas for things to work.

[root@serv1 home]# setquota -u user1 1000000 1500000 200000 300000 -a

I had already mounted the disk with the correct options, but make sure /etc/fstab looks like:

/dev/sda1		/local/home		ext3	defaults,usrquota	1 2

I also then also restarted nfslock, which may or may not have needed to be done. This could have been a totally unrelated problem we were having at the same time.

1. Mount the drive with usrquota as an option
2. touch /local/home/aquota.user
3. chmod 600 /local/home/aquota.user
4. quotacheck -vagum

[root@server home]# quotacheck -vagum
quotacheck: WARNING -  Quotafile /local/home/aquota.user was probably truncated. Can't save quota settings...
quotacheck: Scanning /dev/sda1 [/local/home] quotacheck: Old group file not found. Usage will not be substracted.
done
quotacheck: Checked 5 directories and 7 files
quotacheck: Skipping server1:/local/code [/direct/code]
quotacheck: Skipping server2:/local/web [/direct/web]
quotacheck: Skipping server1:/local/system [/direct/system]

5. Set up a default quota user

edquota defquota

Edit the file that comes up with the quota values you want.

Disk quotas for user psecquota (uid 6004):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/sda1                         0    1000000    1500000          0   200000   300000

6. Make sure quotas are running

quotaon /dev/sda1