How do I determine the block size of an ext3 partition on Linux?
# tune2fs -l /dev/sda1 | grep -i 'block size' Block size: 1024
Replace /dev/sda1 with the partition you want to check.
root, without writing, and for any filesystem type, you can do:
stat -fc %s .
This will give block size of the filesystem mounted in current directory (or any other directory specified instead of the dot).
dumpe2fs -h /dev/md2
will output something with:
Block size: 4096 Fragment size: 4096
On x86, a filesystem block is just about always 4KiB - the default size - and never larger than the size of a memory page (which is 4KiB).
In the case where you don't have the right to run
tune2fs on a device (e.g. in a corporate environment) you can try writing a single byte to a file on the partition in question and check the disk usage:
echo 1 > test du -h test
To detect block size of required partition:
Detect partition name:
$ df -h
for example we have
Detect block size for this partition:
$ sudo blockdev --getbsz /dev/sda1
will also give file size in blocks
sudo dumpe2fs /dev/sda1 | grep "Block size"
where /dev/sda1 is the device partition. You can get it from