December 8, 2012

How to find filesystem block size on Solaris?

Firstly, what is a filesystem block?

It is the smallest piece/size of the disk allocated or accessible on the filesystem.

Can you explain a bit more?

Having a larger block size helps in achieving better performance due to lesser number of disk reads and lower metadata overhead. However, it is a disadvantage for files of smaller size. For example, assuming block size of 8 KB, 8 KB is allocated even if the file size is only 1 KB.

Tell me how do I find the filesystem block size on Solaris?

There’re couple of ways:

  1. From “df -g”; example: df -g | grep "block size" | awk '{print $1 " " $4}'
  2. From “fstype –v”; example: fstyp -v /dev/dsk/c0t1d0s0 | grep ^bsize

2 comments:

jonearles said...

There are some "smart quotes" in the first command that need to be converted to regular quotation marks.

spatnala said...

Thank you for the keen observation. The quotes are fixed now.