1BLOCKDEV(8)                  System Administration                 BLOCKDEV(8)
2
3
4

NAME

6       blockdev - call block device ioctls from the command line
7

SYNOPSIS

9       blockdev [-q] [-v] command [command...] device [device...]
10
11       blockdev --report [device...]
12
13       blockdev -h|-V
14

DESCRIPTION

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

OPTIONS

20       -q
21           Be quiet.
22
23       -v
24           Be verbose.
25
26       --report
27           Print a report for the specified device. It is possible to give
28           multiple devices. If none is given, all devices which appear in
29           /proc/partitions are shown. Note that the partition StartSec is in
30           512-byte sectors.
31
32       -h, --help
33           Display help text and exit.
34
35       -V, --version
36           Print version and exit.
37

COMMANDS

39       It is possible to give multiple devices and multiple commands.
40
41       --flushbufs
42           Flush buffers.
43
44       --getalignoff
45           Get alignment offset.
46
47       --getbsz
48           Print the blocksize in bytes. This size does not describe device
49           topology. It’s the size used internally by the kernel and it may be
50           modified (for example) by filesystem driver on mount.
51
52       --getdiscardzeroes
53           Get discard zeroes support status.
54
55       --getdiskseq
56           Get disk sequence number.
57
58       --getfra
59           Get filesystem readahead in 512-byte sectors.
60
61       --getiomin
62           Get minimum I/O size.
63
64       --getioopt
65           Get optimal I/O size.
66
67       --getmaxsect
68           Get max sectors per request.
69
70       --getpbsz
71           Get physical block (sector) size.
72
73       --getra
74           Print readahead (in 512-byte sectors).
75
76       --getro
77           Get read-only. Print 1 if the device is read-only, 0 otherwise.
78
79       --getsize64
80           Print device size in bytes.
81
82       --getsize
83           Print device size (32-bit!) in sectors. Deprecated in favor of the
84           --getsz option.
85
86       --getss
87           Print logical sector size in bytes - usually 512.
88
89       --getsz
90           Get size in 512-byte sectors.
91
92       --rereadpt
93           Reread partition table
94
95       --setbsz bytes
96           Set blocksize. Note that the block size is specific to the current
97           file descriptor opening the block device, so the change of block
98           size only persists for as long as blockdev has the device open, and
99           is lost once blockdev exits.
100
101       --setfra sectors
102           Set filesystem readahead (same as --setra on 2.6 kernels).
103
104       --setra sectors
105           Set readahead (in 512-byte sectors).
106
107       --setro
108           Set read-only. The currently active access to the device may not be
109           affected by the change. For example, a filesystem already mounted
110           in read-write mode will not be affected. The change applies after
111           remount.
112
113       --setrw
114           Set read-write.
115

AUTHORS

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

REPORTING BUGS

120       For bug reports, use the issue tracker at
121       https://github.com/util-linux/util-linux/issues.
122

AVAILABILITY

124       The blockdev command is part of the util-linux package which can be
125       downloaded from Linux Kernel Archive
126       <https://www.kernel.org/pub/linux/utils/util-linux/>.
127
128
129
130util-linux 2.39.2                 2023-08-17                       BLOCKDEV(8)
Impressum