info > BLOCKDEV

πŸ’Ύ BLOCKDEV(8) System Administration BLOCKDEV(8)

πŸ“œ NAME

blockdev - call block device ioctls from the command line

πŸš€ Quick Reference

Use CaseCommandDescription
Get device size in bytesblockdev --getsize64 /dev/sdaπŸ“ Print device size in bytes
Check read-only statusblockdev --getro /dev/sdaπŸ”’ Returns 1 if read-only, 0 otherwise
Set read-onlyblockdev --setro /dev/sdaπŸ”’ Set device to read-only (remount may be needed)
Get readahead valueblockdev --getra /dev/sdaπŸ“– Print readahead in 512-byte sectors
Flush buffersblockdev --flushbufs /dev/sda🧹 Write all cached data to disk
Reread partition tableblockdev --rereadpt /dev/sdaπŸ”„ Force kernel to reload partition layout

βš™οΈ SYNOPSIS

blockdev [-q] [-v] command [command...] device [device...]

blockdev --report [device...]

blockdev -h|-V

πŸ“– DESCRIPTION

The utility blockdev allows one to call block device ioctls from the command line.

βš™οΈ OPTIONS

πŸ“‚ COMMANDS

It is possible to give multiple devices and multiple commands.

πŸ‘€ AUTHORS

blockdev was written by Andries E. Brouwer and rewritten by Karel Zak.

πŸ› REPORTING BUGS

For bug reports, use the issue tracker at https://github.com/karelzak/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/>.

util-linux 2.37.2 2021-06-02 BLOCKDEV(8)

BLOCKDEV
πŸ“œ NAME πŸš€ Quick Reference βš™οΈ SYNOPSIS πŸ“– DESCRIPTION βš™οΈ OPTIONS πŸ“‚ COMMANDS πŸ‘€ AUTHORS πŸ› REPORTING BUGS πŸ“¦ AVAILABILITY

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:12 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!