mike Asked: 2009-06-23 10:01:54 +0800 CST2009-06-23 10:01:54 +0800 CST 2009-06-23 10:01:54 +0800 CST How do I determine the block size of an ext3 partition on Linux? 772 How do I determine the block size of an ext3 partition on Linux? linux unix filesystems ext3 8 Answers Voted Best Answer skraggy 2009-06-23T10:07:11+08:002009-06-23T10:07:11+08:00 # tune2fs -l /dev/sda1 | grep -i 'block size' Block size: 1024 Replace /dev/sda1 with the partition you want to check. mik 2015-10-13T07:13:20+08:002015-10-13T07:13:20+08:00 Without 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). evcz 2011-02-21T07:00:24+08:002011-02-21T07:00:24+08:00 dumpe2fs -h /dev/md2 will output something with: Block size: 4096 Fragment size: 4096 narthi 2014-12-12T01:31:32+08:002014-12-12T01:31:32+08:00 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 wzzrd 2009-06-23T10:50:15+08:002009-06-23T10:50:15+08:00 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). lospejos 2017-06-14T01:00:43+08:002017-06-14T01:00:43+08:00 To detect block size of required partition: Detect partition name: $ df -h for example we have /dev/sda1 Detect block size for this partition: $ sudo blockdev --getbsz /dev/sda1 foo 2009-08-27T16:43:55+08:002009-08-27T16:43:55+08:00 Use sudo dumpe2fs /dev/sda1 | grep "Block size" where /dev/sda1 is the device partition. You can get it from lsblk Mayur 2015-07-30T07:54:33+08:002015-07-30T07:54:33+08:00 stat <<Filename>> will also give file size in blocks
Replace /dev/sda1 with the partition you want to check.
Without
root
, without writing, and for any filesystem type, you can do:This will give block size of the filesystem mounted in current directory (or any other directory specified instead of the dot).
will output something with:
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: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).
To detect block size of required partition:
Detect partition name:
for example we have
/dev/sda1
Detect block size for this partition:
Use
where /dev/sda1 is the device partition. You can get it from
lsblk
will also give file size in blocks