Check disk block size in Linux

首先,使用 dflsbok 命令查看磁盘所在块设备名称

df -hT


Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/vda1      ext4    15G  2.1G   12G  15% /
tmpfs          tmpfs  372M     0  372M   0% /dev/shm


tune2fs -l /dev/vda1 | grep "Block size"
tune2fs 1.45.6 (20-Mar-2020)
Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          927497f9-eae9-4a2b-bd8b-162997d80076
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              1770496
Block count:              7339472
Reserved block count:     366953
Free blocks:              5384282
Free inodes:              1576749
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      243
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         7904
Inode blocks per group:   494
Flex block group size:    16
Filesystem created:       Thu Oct 10 06:31:31 2019
Last mount time:          Fri Feb 12 02:14:14 2021
Last write time:          Fri Feb 12 02:14:10 2021
Mount count:              13
Maximum mount count:      -1
Last checked:             Sun Jan 17 03:21:58 2021
Check interval:           0 (<none>)
Lifetime writes:          5965 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     32
Desired extra isize:      32
Journal inode:            8
First orphan inode:       6649
Default directory hash:   half_md4
Directory Hash Seed:      19cc95a6-03cd-4dc2-86d2-78b70b1bbbba
Journal backup:           inode blocks
Checksum type:            crc32c
Checksum:                 0x1377592d

  1. License under CC BY-NC 4.0
  2. Copyright issue feedback, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try my iOS App