Operating System - HP-UX
1821051 Members
2776 Online
109631 Solutions
New Discussion юеВ

Filesystem block size 'fstyp -v' vs. 'mkfs -m'

 

Filesystem block size 'fstyp -v' vs. 'mkfs -m'

I confess to being slightly confused about how I determine the 'true' blocksize of a filesystem. Previous posts in the forum and support documents in the technical knowledge base have always advised use of 'fstyp -v' as in the following example:

# fstyp -v /dev/vgsg04/lvol1
vxfs
version: 3
f_bsize: 8192
f_frsize: 1024
f_blocks: 4194304
f_bfree: 4191940
f_bavail: 4191940
f_files: 32
f_ffree: 1073792296
f_favail: 1073792296
f_fsid: 1074003969
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 0
f_fsindex: 6
f_size: 4194304

This seems to indicate a block size of 8192.

However if I use the '-m' option of mkfs then I get a different value:

# mkfs -F vxfs -m /dev/vgsg04/lvol1
mkfs -F vxfs -o ninode=unlimited,bsize=1024,version=3,inosize=256,logsize=1024,nolargefiles /dev/vgsg04/lvol1 4194304

Which seems to indicate a block size of 1024!

Given that I know the filesystem is actually 4GB in size, if you do the math it would appear that the 'true' block size is being given by mkfs (both commands correctly report that there are 4194304 blocks in the filesystem). So what is the value 'f_bsize' being reported by fstyp?

I am an HPE Employee
Accept or Kudo
4 REPLIES 4
eran maor
Honored Contributor

Re: Filesystem block size 'fstyp -v' vs. 'mkfs -m'

Hi Duncan

you are rigth .
the param that you need to look for after applying the comand fstyp is the vaule of the
f_frsize: 1024 .

i know that the comment sense about it is the value f_bsize but he is giving all the time the worng vaule .

check it with other file systems.

there is a doc about this issue : DCLKBRC00006913 in kmine .
love computers
Wodisch
Honored Contributor

Re: Filesystem block size 'fstyp -v' vs. 'mkfs -m'

Hello Duncan,

if you read the man page for "mkfs_vxfs" you will see
that Eran is correct about the default block size of 1KB.
The reason is, that VxFS does not have "blocks and
fragments" - it does only have "blocks" (and those are
1024 bytes in size each).

The output of "fstyp -v" has never been updated for
what reason ever (blind guess: to keep Oracle dbas
satisfied, as they believe they do need 8KB blocks on
the file system level)...

If you use "fsck" on such a filesystem, you will see the
amount of "blocks" in there, and this will be 1KB blocks
on that file system.

HTH,
Wodisch
marc seguin
Regular Advisor

Re: Filesystem block size 'fstyp -v' vs. 'mkfs -m'

When applying "fstyp" command to a hfs filesystem,
f_bsize represents the primary block size
f_frsize represents the fragment size for files
This is the second value which is the block size your are looking for.
The first one is like an amount of space at the beginning of the filesystem, before the real files.

So, for vxfs filesystems, f_bsize is a non-modifyable value (? meaning ?), and f_frsize is the block size used for the filesystem.

HTH
marc.
Roger Baptiste
Honored Contributor

Re: Filesystem block size 'fstyp -v' vs. 'mkfs -m'

Duncan,

Yes, the fs_frsize of the fstyp output
is the actual block size!! It's an commonly
assumed misconception that the fs_bsize
is the block size, which it is not.
An implication of this is, if you want
a 8kb block size (normal for oracle DB),
remember to use the option -b 8192 in
the newfs command while creating the filesystem.

Here is a sample of a 8kb block size filesystem
fstyp output:
-----
vxfs
version: 3
f_bsize: 8192
f_frsize: 8192
f_blocks: 524288
f_bfree: 523988
----


and a 1Kb one:

----
vxfs
version: 3
f_bsize: 8192
f_frsize: 1024
f_blocks: 1572864
f_bfree: 1340516
------

Also, df -g gives you the same confusing
output of block size and fragment size,
with the fragment size being the actual block
size.


-raj
Take it easy.