Tuesday, January 29, 2013

How to find filesystem block size in linux?

To find the size of a block in Linux filesystem, we can try the following
The commands dumpe2fs, tune2fs and blockdev, give the block size of a file in bytes.

# dumpe2fs /dev/sda2 | grep "Block size"
dumpe2fs 1.41.12 (17-May-2010)
Block size:               4096


# tune2fs -l /dev/sda2 | grep -i "Block Size"
Block size:               4096


# blockdev --getbsz /dev/sda2
4096


Create a non-empty file and check it's size

# echo xyx > abc

# du -h abc
4.0K    abc

No comments:

Post a Comment