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