Linux系統的塊大小(Block Size)怎麼查看呢?下麵總結一些常用的查看塊大小(block size)的方法。 方法1: fdisk -l查看block size [root@KerryDB ~]# fdisk -l /dev/sda1 Disk /dev/sda1: 106 MB, 106... ...
Linux系統的塊大小(Block Size)怎麼查看呢?下麵總結一些常用的查看塊大小(block size)的方法。
方法1: fdisk -l查看block size
[root@KerryDB ~]# fdisk -l /dev/sda1
Disk /dev/sda1: 106 MB, 106896384 bytes, 208782 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Alignment offset: 512 bytes
方法2:stat命令查看block size
[root@KerryDB ~]# stat / | grep "IO Block"
Size: 260 Blocks: 0 IO Block: 4096 directory
[root@KerryDB ~]# stat -f /
File: "/"
ID: fd0000000000 Namelen: 255 Type: xfs
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 13100800 Free: 11998605 Available: 11998605
Inodes: Total: 26214400 Free: 26170926
方法3:tune2fs命令查看block size
[root@mylnx ~]# tune2fs -l /dev/sda1 | grep "Block size"
Block size: 1024
這裡可以是/dev/sda1, 對於LVM文件系統,可以使用下麵命令
# tune2fs -l /dev/mapper/VolGroup04-LogVol00 | grep -i 'block size'
Block size: 4096
方法4:blockdev命令查看block size
[root@KerryDB ~]# blockdev --getbsz /dev/sda2
4096