Detect block size for quota in Linux

Posted by Chen Levy on Stack Overflow See other posts from Stack Overflow or by Chen Levy
Published on 2010-03-24T08:44:02Z Indexed on 2010/03/24 8:53 UTC
Read the original article Hit count: 416

Filed under:
|
|
|
|

The limit placed on disk quota in Linux is counted in blocks. However, I found no reliable way to determine the block size. Tutorials I found refer to block size as 512 bytes, and sometimes as 1024 bytes.

I got confused reading a post on LinuxForum.org for what a block size really means. So I tried to find that meaning in the context of quota.

I found a "Determine the block size on hard disk filesystem for disk quota" tip on NixCraft, that suggested the command:

dumpe2fs /dev/sdXN | grep -i 'Block size'

or

blockdev --getbsz /dev/sdXN

But on my system those commands returned 4096, and when I checked the real quota block size on the same system, I got a block size of 1024 bytes.

Is there a scriptable way to determine the quota block size on a device, short of creating a known sized file, and checking it's quota usage?

© Stack Overflow or respective owner

Related posts about quota

Related posts about linux