Linux查看系统块大小
程序员文章站
2022-07-09 19:51:59
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
上一篇: Spring boot 拦截器和过滤器
下一篇: RocketMQ面试题及答案