blkpr
Display or modify block device attributes
TLDR
Register (command) a new reservation with a given key on a given device
Set the type of an existing reservation to exclusive access
Preempt the existing reservation with a given key and replace it with a new reservation
Release a reservation with a given key and type on a given device
Clear all reservations from a given device
SYNOPSIS
blkpr [options] <device>
PARAMETERS
-h, --help
Display help text and exit.
-V, --version
Display version information and exit.
-o FORMAT, --output=FORMAT
Select output format: native (default) or json.
-b, --bytes
Print sizes in bytes rather than human-readable format.
DESCRIPTION
The blkpr command displays key parameters of Linux block devices, such as rotational status, I/O queue depth, read-ahead size, and discard capabilities. It queries the device's /sys/block directory for runtime and static properties, helping administrators tune storage performance, diagnose hardware issues, or script automation for NVMe, SSDs, or HDDs.
Useful in environments with diverse storage backends, blkpr provides concise output for parameters like nomerges, rq_affinity, and iothread, aiding in scheduler selection (e.g., mq-deadline, none) and optimizing workloads. Output formats include human-readable native or structured JSON, making it ideal for parsing in tools like Ansible or monitoring scripts.
Run on devices like /dev/nvme0n1 or /dev/sda to inspect settings without unloading drivers.
CAVEATS
Requires read access to /sys/block/<dev>/queue/; may need root privileges for some devices. Does not support multiple devices.
EXAMPLE OUTPUT
blkpr /dev/sda
rotational: 1
queue_depth: 32
read_ahead_kb: 128
nr_requests: 128
JSON USAGE
blkpr -o json /dev/nvme0n1 for parseable output in monitoring scripts.
HISTORY
Introduced in util-linux 2.32 (2017) to consolidate block device inspection tools, evolving from older sysfs queries.


