Scroll to navigation

BLOCKDEV(8) System Manager's Manual BLOCKDEV(8)

NAME

blockdev - call block device ioctls from the command line

SYNOPSIS

blockdev [options] commands devices
blockdev --report [devices]

DESCRIPTION

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

OPTIONS

Print version and exit.
Be quiet.
Be verbose.
Print a report for devices. Note that the partition StartSec is in 512-byte sectors.

COMMANDS

Set read-only.
Set read-write.
Get read-only. Print 1 if the device is read-only, 0 otherwise.
Print sectorsize in bytes - usually 512.
Print blocksize in bytes.
Set blocksize to N bytes. 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.
Print device size in sectors (BLKGETSIZE). Deprecated in favor of the --getsz option.
Print device size in bytes (BLKGETSIZE64)
Get size in 512-byte sectors (BLKGETSIZE64 / 512).
Set readahead to N 512-byte sectors.
Print readahead (in 512-byte sectors).
Set filesystem readahead (same like --setra on 2.6 kernels).
Get filesystem readahead.
Flush buffers.
Reread partition table.

AUTHOR

blockdev was written by Andries E. Brouwer.

AVAILABILITY

The blockdev command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

Jun 2007