Operating System - Linux
1820619 Members
1817 Online
109626 Solutions
New Discussion юеВ

Re: How set disk space for particular user using command edquota

 
debian111
Regular Advisor

How set disk space for particular user using command edquota

Hi all,

last weekend I tried to add quota to some users on my server running Debian Sarge 3.1. ( First I added into /etc/fstab after defaults, userquota, grpquota.....I wanted to modified disk values for users on my home direcory---/dev/hda6)
I used command edquota -u xzy and I got VIM editable file to enter desirable disk values, after entering I wrote wq!+enter and I got next output:

edquota :WARNING /dev/hda6 cannot change current block allocation


afret that I entered command repquota -a and I got output qouta for all users including xzy, but field blocks still remain as before comand edquota -u xzy

Only I want edit disk space for particular users, and I found (I used google and man edquota) command edquota will help me to do it.
I would pritiete all kind of help and suggestions, because I have no idea how to solve problem I have.

Thank you in advance.
5 REPLIES 5
Ivan Ferreira
Honored Contributor

Re: How set disk space for particular user using command edquota

I think that you are editing the wrong value, you cannot edit the first value that indicates how much is used, you must edit the second or third value (hard and soft limit).
That's why you get:

cannot change current block allocation
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
debian111
Regular Advisor

Re: How set disk space for particular user using command edquota

Thank yoo, if I cannot edit blocks field then it is ok, but I am wondering why I cannot change blocks field and add different value for particular user?

Thank you
regards
Ivan Ferreira
Honored Contributor

Re: How set disk space for particular user using command edquota

I dont understand whell your question, for example:

edquota -u iferreira

Disk quotas for user iferreira (uid 506):

Disk quotas for user iferreira (uid 506):
Filesystem blocks soft hard inodes soft
hard
/dev/hda1 0 0 0 0 0
0

If I edit block line like this:

Disk quotas for user iferreira (uid 506):
Filesystem blocks soft hard inodes soft
hard
/dev/hda1 1000 0 0 0 0
0

I get:
edquota: WARNING - /dev/hda1: cannot change current block allocation

The first field is the currently used blocks, so you cannot edit that, that information will be updated when the user creates files on the file system.

So you must edit the second and third field:

Disk quotas for user iferreira (uid 506):
Filesystem blocks soft hard inodes soft
hard
/dev/hda1 0 10000 20000 0 0
0

You CAN set the blocks limits, but these values are configured in the second and third field.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
debian111
Regular Advisor

Re: How set disk space for particular user using command edquota

My /etc/fstab folder has structure like bellow.

cat /etc/fstab
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/sda9 /home ext3 defaults,usrquota 1 1
/dev/sda8 /tmp ext3 defaults 0 2
/dev/sda5 /usr ext3 defaults 0 2
/dev/sda6 /var ext3 defaults 0 2
/dev/sda7 none swap sw 0 0
/dev/hda /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0


I edited /etc/fstab to prepare it for disk qouota, I would like to edit /home partition





Bellow is output of repquota on my machine.
I used edquota to edit disk apace for user zippo

repquota -a
*** Report for user quotas on device /dev/sda9
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 62760 0 0 20 0 0
andrejk -- 36420 0 0 449 0 0
lfs -- 8 0 0 2 0 0
zippo -- 8 100 200 2 0 0

The output of quotaon -u zippo is as follows

quotaon -u zippo
quotaon: Can't stat() given mountpoint zippo: No such file or directory
Skipping...
quotaon: No correct mountpoint specified.

I tried to assign /home as mount point

quotaon -u zippo /home
quotaon: Can't stat() given mountpoint jebac: No such file or directory
Skipping...
quotaon: using /home/aquota.user on /dev/sda9 [/home]: Device or resource busy


What to do next in order to make this works..
Thank you
Regards

Ivan Ferreira
Honored Contributor

Re: How set disk space for particular user using command edquota

Have you remounted the filesystem after the quota settings on fstab?

mount -o remount /home
mount -o usrquota,remount /home

Then you need to run quotacheck and quotaon.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?