Determine the block size on hard disk filesystem for disk quota
When configuring user disk quotas I need to find out the block size on my SCSI hard disk drive. For example if I am using a block size of 1024 then setting block size to 102400 blocks limit my user to 100MB of disk space.
Therefore, it is necessary to determine the correct block size; otherwise, I will end up assigning wrong disk quota limit.
You can use dumpe2fs command, which prints the super block and blocks group information for the filesystem present on device. You need to type dumpe2fs command as the root user:
# dumpe2fs /dev/sdb3 | grep -i 'Block size'
Output:
Block size: 4096
Now setting a user quota of 40960 would limit a user to 10MB of disk space.
Please note that dumpe2fs command used to determine the actual size of a block on the filesystem (and not BLOCK SIZE OF FILESYSTEM not harddisk).
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in...
- How To Setup Disk Quotas For MySQL Database
- The importance of Linux partitions
- Linux Creating a Partition Size Larger than 2TB
- Postfix mail server limit the mailbox size
- Linux hard drive benchmark & bottleneck testing software suite for performance
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
~ Last updated on: May 29, 2006


hi,
i think that this is BLOCK SIZE OF FILESYSTEM not harddisk. Title is a bit missleading. BLOCK SIZE OF DISK is allmost always 512B
Opps
you are right. Above command is to determine the actual size of a block on the filesystem.
Thanks, I will update post
I just found this post, it was exactly what I was looking for, thanks for the help
Just two things:
1) on my system I had to use double quotes rather than single quotes,
2) I think this means that 100MB could be bigger on one system than another? Am I right?
100MB is the same size on one system as it is on another. However, with varying block sizes, 100MB may spread over more blocks on systems with smaller block sizes than it does on a system with a larger block size.
For example, on a system with a 512B block size 100MB will take up 204800 blocks. On a system with a 64K block size 100MB will take up 1600 blocks.