blockdev
(8)call block device ioctls from the command line
Options
28-qBe quiet.
-vBe verbose.
--reportPrint a report for the specified device. It is possible to give multiple devices. If none is given, all devices which appear in /proc/partitions are shown. Note that the partition StartSec is in 512-byte sectors.
-h--helpDisplay help text and exit.
-V--versionDisplay version and exit.
--flushbufsFlush buffers.
--getalignoffGet alignment offset.
--getbszPrint the blocksize in bytes. This size does not describe device topology. It’s the size used internally by the kernel and it may be modified (for example) by filesystem driver on mount.
--getdiscardzeroesGet discard zeroes support status.
--getdiskseqGet disk sequence number.
--getzoneszGet zone size in 512-byte sectors.
--getfraGet filesystem readahead in 512-byte sectors.
--getiominGet minimum I/O size.
--getiooptGet optimal I/O size.
--getmaxsectGet max sectors per request.
--getpbszGet physical block (sector) size.
--getraPrint readahead (in 512-byte sectors).
--getroGet read-only. Print 1 if the device is read-only, 0 otherwise.
--getsize64Print device size in bytes.
--getsizePrint device size (32-bit!) in sectors. Deprecated in favor of the --getsz option.
--getssPrint logical sector size in bytes - usually 512.
--getszGet size in 512-byte sectors.
--rereadptReread partition table.
--setbszbytesSet blocksize. Note that the block size is specific to the current file descriptor opening the block device, so the change of block size only persists for as long as blockdev has the device open, and is lost once blockdev exits.
--setfrasectorsSet filesystem readahead (same as --setra on 2.6 kernels).
--setrasectorsSet readahead (in 512-byte sectors).
--setroSet read-only. The currently active access to the device may not be affected by the change. For example, a filesystem already mounted in read-write mode will not be affected. The change applies after remount.
--setrwSet read-write.
DESCRIPTION
COMMANDS
It is possible to give multiple devices and multiple commands.
--flushbufs
--getalignoff
--getbsz
--getdiscardzeroes
--getdiskseq
--getzonesz
--getfra
--getiomin
--getioopt
--getmaxsect
--getpbsz
--getra
--getro
--getsize64
--getsize
--getss
--getsz
--rereadpt
--setbsz bytes
--setfra sectors
--setra sectors
--setro
--setrw
AUTHORS
REPORTING BUGS
For bug reports, use the issue tracker https://github.com/util-linux/util-linux/issues.
AVAILABILITY
The blockdev command is part of the util-linux package which can be downloaded from Linux Kernel Archive https://www.kernel.org/pub/linux/utils/util-linux/.