1833796 Members
4487 Online
110063 Solutions
New Discussion

Block size

 
Scott Dunkley
Regular Advisor

Block size

How do I find the current block size ? and what is the default ?

Thanks in advance,

Scott.
Better to regret something you have done, than something you havn't
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: Block size


fstyp -v /dev/vgXX/rlvolXX | grep bsize

Gives you the blocksize for JFS filesystems. Default is 8k
Im from Palmerston North, New Zealand, but somehow ended up in London...
Vincenzo Restuccia
Honored Contributor

Re: Block size

#fstyp -v /dev/vg00/lvol8
vxfs
version: 3
f_bsize: 8192
f_frsize: 1024
f_blocks: 712704
f_bfree: 146227
f_bavail: 146227
f_files: 21504
f_ffree: 1073792296
f_favail: 1073792296
f_fsid: 1073741832
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 0
f_fsindex: 6
f_size: 712704
Carsten Krege
Honored Contributor

Re: Block size

The default block size of VxFS is 1kB, not 8kB as one could judge from the fstyp output. I believe that fstyp should simply present the output in a better way and more suitable for VxFS.

You can calculate the size of a single block by running fstyp and dividing the size of the filesystem by f_blocks (number of blocks).
In fstyp's output the value of the blocksize of a VxFS is given by f_frsize and not by f_bsize!

Even more direct you get the block size (that you can set with "mkfs -F vxfs -o bsize=xxx .. ") with the command

#echo "X b; p S" |fsdb -F vxfs /dev/vg00/lvol14

(X=1 if bsize=8192, X=2 if bsize=4096, X=4 if bsize=2048, X=8 if bsize=1024). X=8 is default.
This gives you the superblock information of the filesystem.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Stefan Farrelly
Honored Contributor

Re: Block size


Im afraid everyone is wrong. Check out the following link to the definitive answer from Bil Hassel; 512 bytes it is!

http://www.dutchworks.nl/htbin/hpsysadmin?h=3&dn=53521&q=blocksi%7ae&fh
Im from Palmerston North, New Zealand, but somehow ended up in London...
Carsten Krege
Honored Contributor

Re: Block size

No, the block size of VxFS is 1kB (or call it the extent size, which is more appropriate. .). 1kB is the smallest amount of data a VxFS can ever access.

The DEV_BSIZE is something different and is 512 byte by default. The DEV_BSIZE is the smallest amount of data the disk hardware can access. Of course any filesystem access cannot read/write smaller amounts of data than DEV_BSIZE, it is only possible to access multiples of DEV_BSIZE. Using DEV_BSIZE blocks as the computational unit on all disk devices allows the file system to avoid managing different I/O unit sizes for different devices.

So, it is still correct: The bsize of VxFS is 1kB by default/minimum and 8kB at maximum. It is a different story how the hardware accesses the filesystem blocks.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Vincenzo Restuccia
Honored Contributor

Re: Block size

You specify the block size when a file system is created; it cannot be changed later. The standard HFS file system defaults to a block size of 8K with a 1K fragment size. This means that space is allocated to small files (up to 8K) in 1K increments. Allocations for larger files are done in 8K increments except for the last block, which may be a fragment. Because many files are small, the fragment facility saves a large amount of space compared to allocating space 8K at a time.
The unit of allocation in VxFS is a block. There are no fragments because storage is allocated in extents that consist of one or more blocks. The smallest block size available is 1K, which is also the default block size for VxFS file systems created on file systems of less than 8 gigabytes.

See http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B3929-90011/B3929-90011_top.html&con=/hpux/onlinedocs/B3929-90011/00/00/44-con.html&toc=/hpux/onlinedocs/B3929-90011/00/00/44-toc.html&searchterms=Block%7csize&queryid=20010517-053500