blockdev

最後更新: 2022-01-20

介紹

Call block device ioctls from the command line

目錄


readahead

 

# Set readahead (in 512-byte sectors) per device

# Set read-ahead to 32 MiB (512 * 2 * 1024 = 65536)

blockdev --setra 65536 /dev/mdX

 


查看 Harddisk 的 Size

 

# Print a report for the specified device

blockdev --report /dev/md127

RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0   4000650690560   /dev/md127

RA = read-ahead (--getra)                # Get read-ahead in 512-byte sectors

SSZ = sector size (--getss)               # Get logical sector size

BSZ = blocksize (--getpbsz)              # Get physical block size

Size = harddisk 的 size                     # Unit: bytes

 


Check Disk Block Size

 

# Print logical sector size in bytes, usually 512 (512e)

blockdev --getss /dev/sda

# Print physical block size, usually 4096 (4k)

blockdev --getpbsz /dev/sda

 


 

Creative Commons license icon Creative Commons license icon