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’


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

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

20 comments… add one
  • mj May 29, 2006 @ 16:57

    i think that this is BLOCK SIZE OF FILESYSTEM not harddisk. Title is a bit missleading. BLOCK SIZE OF DISK is allmost always 512B

  • LinuxTitli May 29, 2006 @ 17:08

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

    Thanks, I will update post 🙂

  • Tortanick Jan 4, 2007 @ 11:58

    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?

  • Teslamike Mar 28, 2007 @ 15:04

    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.

  • James Cape Mar 8, 2009 @ 16:49

    Umm, 409600 blocks = 409600(blocks) * 4096(B) = 1.6G

  • linuxrawkstar Apr 23, 2009 @ 18:56

    Nice tip. The comment by James Cape assumes that all block sizes are all the same, all the time, on all filesystems… hmmm. Is that true??

  • Shane Menshik Jun 13, 2009 @ 11:07

    You can also get the block size for all disks using the following command, as well as readahead, size, etc.

    blockdev –report

  • beanluc Jul 17, 2009 @ 18:39


    No, James Cape’s tip doesn’t assume that all block sizes are all the same, all the time, on all filesystems.

    His tip specifically follows the example in the article, in which LINUXTITLI “discovered” a 4096b block size for the filesystem he was discussing.

    LINUXTITLI, and Shane too, already showed how to discover block size for some other particular filesystem.

  • Ramesh Nov 17, 2009 @ 12:05

    I am a bit confused…

    when I try to see block size with command “/sbin/dumpe2fs -h /dev/mapper/System-home”
    then it says:

    Block size: 4096

    but when i run df command: it shows
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/mapper/System-home 61958132 49838676 8972092 85% /home

    and when I run df -h, it shows

    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/mapper/System-home 60G 48G 8.6G 85% /home

    does this mean that 1Kb = 4096 blocks ??

  • TodayLinux Dec 19, 2009 @ 11:54

    Hello Vivek / Admin,

    This article is little confusing. I would suggest to make necessary correction on this article.

    The output of # dumpe2fs /dev/sdb3 | grep -i ‘Block size’ is IO Block size. not the block size of filesystem which is 512K (each sector size). In your example 8 x 512K = 4096K, which is the default IO Block size.

  • parvesh Jan 31, 2010 @ 5:27

    hi all,
    just wanted to know how no of blocks and size of disk are related just suppose i have 500gb of hard disk how blocks are numbered and how many bytes in one block

  • Chen Levy Mar 25, 2010 @ 7:18

    The above tip seems to be wrong.

    Apparently there are more then one meaning to the term “block size”. The original post refers to the file-system block size, while quota uses a system constant that is a feature of the running kernel.

    See Detect block size for quota in Linux question on StackOverflow.

    • Alan Nov 28, 2011 @ 11:19

      You’re absolutely right. quotas always use a 1k block size regardless of the file system’s block size. This was very confusing for me!

  • david Mar 14, 2011 @ 11:11

    Hi all (5 years later),

    If block size is 4096 bytes (4KB) then disk quota of 10 MB for one user is:

    10MB / 4KB = 2560 blocks

    What am I missing?

    • yao Aug 11, 2011 @ 5:10

      david, my understanding about block size is just the same as you. i think maybe the author made some mistake

      • testinguser Feb 13, 2012 @ 16:26

        Agreed, it seems the original post is potentially incorrect. My understanding is that you first need to calculate the total size you want in bytes and divide it by the block size.

        EG: 100MB = 1024 x 1024 x 100 – this is the definition of 100Megabytes

        Then depending on your file system block size, you divide by that to get your number of blocks.

        So just like David explained: 1024x1024x100 = 104,857,600 / 4096 = 25600

        25600 blocks

        1GB = 1024x1024x1024 / 4096 = 262144 blocks

        However, in my case I’m trying to determine what is the block size used by the quota system, or how can I find out what that is? My fs is mounted using a 4096 byte block size, but quota doesn’t seem to be using the same block size to set it’s limits. I assume it’s going by 1024 byte block sizes. Is there anyway to verify that without writing a C program and using the ‘sys/mount.h’ library?

  • Charles Vlk (kunk) Mar 19, 2011 @ 18:50

    “Now setting a user quota of 40960 would limit a user to 10MB of disk space.” Yeah, I don’t the math here is right if the block size is 4096 B or 4 KiB.

    40960 * 4 KiB = 160 MiB
    40 * 1024 * 4 * 1024 = 160 * 1024^2
    1024^2 = Mi

  • ManikantaVarma Sep 22, 2011 @ 10:22

    The size of the dataBlock in system is equal to size of the page in system.

    check with getpagesize() & dumpe2fs.


  • ManikantaVarma Sep 22, 2011 @ 10:27

    create an empty file say file.txt by touch command.
    touch file.txt
    then type this comman on konsole
    # du -h file.txt


  • Muzza Mar 10, 2014 @ 3:13

    An alternative command.

    # /sbin/blockdev –getbsz /dev/sda1

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.