系統管理
1752701 會員
5451 線上
108789 解決方案
發表新文章

default mkfs block size應該是多少

 
watermelonyu
教授

default mkfs block size應該是多少

我從某篇文章上看到........

Typically (in 11.x) when a vxfs FS is created even without the "-b" option it'll default to 8K block size

我不加block size 去makefs如下.....

#mkfs -F vxfs -o largefiles /dev/vg00/rlvol11

#fstyp -v /dev/vg00/rlvol11

f_bsize: 8192

# echo "8192B.p S" | fsdb -F vxfs /dev/vg00/rlvol11

bsize 1024

這兩個地方出現的值怎會不一樣.........

到底哪個才是真的



但是假如我我指定block size,下列兩個bsize就一樣了

#mkfs -F vxfs -o largefiles,bsize=8192 /dev/vg00/rlvol11

f_bsize: 8192

#echo "8192B.p S" | fsdb -F vxfs /dev/vg00/rlvol11

bsize 8192
2則回覆 2
watermelonyu
教授

default mkfs block size應該是多少

From the man page of mkfs_vxfs,

bsize=n

n is the block size for files on the file

system and represents the smallest amount of

disk space allocated to a file. n must be a

power of 2 selected from the range 1024 to

8192.



The default is 1024 for file systems

less than 8 gigabytes, 2048 for file systems

less than 16 gigabytes, 4096 for file systems

less than 32 gigabytes, and 8192 for larger

file systems.

watermelonyu
教授

default mkfs block size應該是多少

when you use fstyp -v to check the block size

of a file system, what field you need to look

at is f_frsize instead of f_bsize.

Because



1. fstyp(1m) command uses statvfsdev(3C) to obtain its data



2. From /usr/include/sys/_statvfs_body.h



struct __statvfs {



unsigned long f_bsize; /* preferred file system block size */

unsigned long f_frsize; /* Fundamental file system block size */



3. From kernel source



sp->f_bsize = VX_MAXBSIZE;

#define VX_MAXBSIZE 8192 /* largest block on any vxfs fs */



sp->f_frsize = fs->fs_bsize;

#define fs_bsize fs_dsk.fs_c.fsc_bsize

vx_u32_t fsc_bsize; /* size of blocks in fs */



Summary :

f_bsize: 8192 <---- f_bsize == VX_MAXBSIZE == 8192

f_frsize: 1024 <---- f_frsize == fsc_bsize == 1024 for this vxfs



Finally to summarise; I believe you need to be looking at the

f_frsize field of fstyp(1m) in order to determine the vxfs

block size correctly.