Polls

Topics

Determine the block size on hard disk filesystem for disk quota

Posted by Vivek on Monday May 8, 06 @4:00 pm

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...

Discussion on This Article:

  1. mj Says:

    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

  2. LinuxTitli Says:

    Opps :( you are right. Above command is to determine the actual size of a block on the filesystem.

    Thanks, I will update post :)

  3. Tortanick Says:

    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?

  4. Teslamike Says:

    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.

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!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

~ Last updated on: May 29, 2006

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.