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