OS Manuals

/usr/bin/blockdev

Call block device ioctls from the command line

From blockdev 2.42.4-r2 (os), captured 2026-11-05 by running blockdev --help (exit 0). permalink

Usage:
 blockdev [-v|-q] commands devices
 blockdev --report [devices]
 blockdev -h|-V

Call block device ioctls from the command line.

Options:
 -q             quiet mode
 -v             verbose mode
     --report   print report for specified (or all) devices

 -h, --help     display this help
 -V, --version  display version

Available commands:
 --getsz                   get size in 512-byte sectors
 --setro                   set read-only
 --setrw                   set read-write
 --getro                   get read-only
 --getdiscardzeroes        get discard zeroes support status
 --getss                   get logical block (sector) size
 --getpbsz                 get physical block (sector) size
 --getiomin                get minimum I/O size
 --getioopt                get optimal I/O size
 --getalignoff             get alignment offset in bytes
 --getmaxsect              get max sectors per request
 --getbsz                  get blocksize
 --setbsz <bytes>          set blocksize on file descriptor opening the block device
 --getsize                 get 32-bit sector count (deprecated, use --getsz)
 --getsize64               get size in bytes
 --setra <sectors>         set readahead
 --getra                   get readahead
 --setfra <sectors>        set filesystem readahead
 --getfra                  get filesystem readahead
 --getdiskseq              get disk sequence number
 --getzonesz               get zone size
 --flushbufs               flush buffers
 --rereadpt                reread partition table

For more details see blockdev(8).
Options (28)
OptionDescriptionSource
-qquiet modehelp + man
-vverbose modehelp + man
--reportprint report for specified (or all) deviceshelp + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man
--getszget size in 512-byte sectorshelp
--setroset read-onlyhelp
--setrwset read-writehelp
--getroget read-onlyhelp
--getdiscardzeroesget discard zeroes support statushelp
--getssget logical block (sector) sizehelp
--getpbszget physical block (sector) sizehelp
--getiominget minimum I/O sizehelp
--getiooptget optimal I/O sizehelp
--getalignoffget alignment offset in byteshelp
--getmaxsectget max sectors per requesthelp
--getbszget blocksizehelp
--setbsz bytesset blocksize on file descriptor opening the block devicehelp
--getsizeget 32-bit sector count (deprecated, use --getsz)help
--getsize64get size in byteshelp
--setra sectorsset readaheadhelp
--getraget readaheadhelp
--setfra sectorsset filesystem readaheadhelp
--getfraget filesystem readaheadhelp
--getdiskseqget disk sequence numberhelp
--getzoneszget zone sizehelp
--flushbufsflush buffershelp
--rereadptreread partition tablehelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.