]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/blockdev.8
agetty: fix output of escaped characters
[thirdparty/util-linux.git] / disk-utils / blockdev.8
1 .\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
2 .\" Copyright 2007 Karel Zak <kzak@redhat.com>
3 .\"
4 .\" May be distributed under the GNU General Public License
5 .TH BLOCKDEV 8 "August 2010" "util-linux" "System Administration"
6 .SH NAME
7 blockdev \- call block device ioctls from the command line
8 .SH SYNOPSIS
9 .B blockdev
10 .RB [ \-q ]
11 .RB [ \-v ]
12 .I command
13 .RI [ command \&...\&]
14 .I device
15 .RI [ device \&...\&]
16 .br
17 .B blockdev
18 .B \-\-report
19 .RI [ device \&...\&]
20 .br
21 .B blockdev
22 .RB \-h | \-V
23 .SH DESCRIPTION
24 The utility
25 .B blockdev
26 allows one to call block device ioctls from the command line.
27 .SH OPTIONS
28 .IP "\fB\-q\fP"
29 Be quiet.
30 .IP "\fB\-v\fP"
31 Be verbose.
32 .IP "\fB\-\-report\fP"
33 Print a report for the specified device. It is possible to give multiple
34 devices. If none is given, all devices which appear in /proc/partitions are
35 shown. Note that the partition StartSec is in 512-byte sectors.
36 .IP "\fB\-h\fR, \fB\-\-help\fR"
37 Display help text and exit.
38 .IP "\fB\-V\fR, \fB\-\-version\fR"
39 Print version and exit.
40 .SH COMMANDS
41 It is possible to give multiple devices and multiple commands.
42 .IP "\fB\-\-flushbufs\fP"
43 Flush buffers.
44 .IP "\fB\-\-getalignoff\fP"
45 Get alignment offset.
46 .IP "\fB\-\-getbsz\fP"
47 Print blocksize in bytes.
48 .IP "\fB\-\-getdiscardzeroes\fP"
49 Get discard zeroes support status.
50 .IP "\fB\-\-getfra\fP"
51 Get filesystem readahead in 512-byte sectors.
52 .IP "\fB\-\-getiomin\fP"
53 Get minimum I/O size.
54 .IP "\fB\-\-getioopt\fP"
55 Get optimal I/O size.
56 .IP "\fB\-\-getmaxsect\fP"
57 Get max sectors per request
58 .IP "\fB\-\-getpbsz\fP"
59 Get physical block (sector) size.
60 .IP "\fB\-\-getra\fP"
61 Print readahead (in 512-byte sectors).
62 .IP "\fB\-\-getro\fP"
63 Get read-only. Print 1 if the device is read-only, 0 otherwise.
64 .IP "\fB\-\-getsize64\fP"
65 Print device size in bytes.
66 .IP "\fB\-\-getsize\fP"
67 Print device size (32-bit!) in sectors. Deprecated in favor of the \-\-getsz option.
68 .IP "\fB\-\-getss\fP"
69 Print logical sector size in bytes \(en usually 512.
70 .IP "\fB\-\-getsz\fP"
71 Get size in 512-byte sectors.
72 .IP "\fB\-\-rereadpt\fP"
73 Reread partition table
74 .IP "\fB\-\-setbsz\fP \fIbytes\fP"
75 Set blocksize. Note that the block size is specific to the current file
76 descriptor opening the block device, so the change of block size only persists
77 for as long as blockdev has the device open, and is lost once blockdev exits.
78 .IP "\fB\-\-setfra\fP \fIsectors\fP"
79 Set filesystem readahead (same like \-\-setra on 2.6 kernels).
80 .IP "\fB\-\-setra\fP \fIsectors\fP"
81 Set readahead (in 512-byte sectors).
82 .IP "\fB\-\-setro\fP"
83 Set read-only. The currently active access to the device may not be affected by the change. For example
84 filesystem already mounted in read-write mode will not be affected. The change applies after remount.
85 .IP "\fB\-\-setrw\fP"
86 Set read-write.
87 .SH AUTHOR
88 blockdev was written by Andries E.\& Brouwer and rewritten by Karel Zak.
89 .SH AVAILABILITY
90 The blockdev command is part of the util-linux package and is available from
91 https://www.kernel.org/pub/linux/utils/util-linux/.