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 and without writing, one can do:
stat -fc %s .
This will give block size of the filesystem in current directory.
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, f.e. we have /dev/sda1
Detect block size for this partition:
$ sudo blockdev --getbsz /dev/sda1
dumpe2fs |grep Block
will also give file size in blocks