linux命令vmstat以及Linux块大小查看

    科技2024-03-27  84

    vmstat - Report virtual memory statistics # 每隔1秒输出1组数据 $ vmstat 1 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 7743608 1112 92168 0 0 0 0 52 152 0 1 100 0 0 0 0 0 7743608 1112 92168 0 0 0 0 36 92 0 0 100 0 0

    buff 和 cache 就是我们前面看到的 Buffers 和 Cache,单位是 KB。 bi 和 bo 则分别表示块设备读取和写入的大小,单位为块 / 秒。 因为 Linux 中块的大小是 1KB,所以这个单位也就等价于 KB/s。

    linux查看块大小

    使用stat

    stat -f / File: "/" ID: 3665254bba17ca0f Namelen: 255 Type: ext2/ext3 Block size: 4096 Fundamental block size: 4096 Blocks: Total: 10255160 Free: 8597273 Available: 8068915 Inodes: Total: 2621440 Free: 2492457

    块大小为4kB

    使用fdisk

    fdisk -l Disk /dev/vda: 40 GiB, 42949672960 bytes, 83886080 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xe6bc4008 Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 83884031 83881984 40G 83 Linux

    使用fdisk

    blockdev --getbsz /dev/vda 4096

    发现查询的块大小不一样

    具体解释

    https://blog.csdn.net/hintonic/article/details/8638546

    Processed: 0.014, SQL: 8