Disk Quota... in MB?
Hi,
I have set a system up so i can limit the amout of space a user can use. The question i have is this. What numbers do i put in! I know for example that i want this user to have a hard limit of 250MB. So do i just put 250 under hard, or does it need to be in a diffrent format? Disk quotas for user localtest (uid 503): Filesystem blocks soft hard inodes soft hard /dev/sdb2 0 0 0 0 0 0 Many thanks |
disk quotas are set using blocks and are set on a per file system (partition) basis. /home should be on it's own partition. Divide the number of blocks by the number of users if you want all users to have the same amount of disk space.
You can use the command Code:
fdisk -l |
thanks... Is there a way that i can work out how many blocks there are to a single MB?
|
This should get you close. Divide the number of blocks on the partition by the 1024. This will give you the blocks per megabyte. Multiply the blocks per megabyte times the number of megabytes that you want a user to have. This will give you the number of blocks to use.
For instance I have a partition with 12586896 blocks. I know this by using the fdisk -l command I mentioned earlier. Now divide that by 1024: Code:
[root@john-fc6 jslittl]# expr 12586896 \/ 1024 Code:
[root@john-fc6 jslittl]# expr 20 \* 12291 hth |
Fantastic! Many Thanks.
|
The "df" or "fdisk -l" listings assume the blocks are 1K blocks. So there are 1024 1-k blocks per Megabyte.
Double check that your file-system uses 1K blocks. According to the Coreutils manual: Quote:
Check your own documentation on what blocksize quota uses on your own system. I don't know offhand if quota uses an arbitrary blocksize or gets it from the filesystem. And I won't assume an answer for me is the correct answer for you. The ext2 filesystem can have 1024, 2048, and 4096 bytes per block as an option to mkefs. You can check on the blocksize of a fileystem with the debugfs program. |
All times are GMT -5. The time now is 04:30 PM. |