summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--disk-utils/blockdev.8120
-rw-r--r--disk-utils/blockdev.c10
2 files changed, 61 insertions, 69 deletions
diff --git a/disk-utils/blockdev.8 b/disk-utils/blockdev.8
index fa01da54..c3d5dfd7 100644
--- a/disk-utils/blockdev.8
+++ b/disk-utils/blockdev.8
@@ -3,90 +3,82 @@
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
.\"
.\" May be distributed under the GNU General Public License
-.TH BLOCKDEV 8 "Jun 2007" ""
+.TH BLOCKDEV 8 "Aug 2010" ""
.SH NAME
blockdev \- call block device ioctls from the command line
.SH SYNOPSIS
.B blockdev
-.RI [ options ]
-.I commands devices
+.RB [ \-q ]
+.RB [ \-v ]
+.IR command
+.RI [ command ...]
+.IR device
+.RI [ device ...]
.br
.B blockdev
.B \-\-report
-.RI [ devices ]
+.RI [ device ...]
.SH DESCRIPTION
The utility
.B blockdev
allows one to call block device ioctls from the command line.
.SH OPTIONS
-.TP
-.B \-V
+.IP "\fB\-V\fP"
Print version and exit.
-.TP
-.B \-q
+.IP "\fB\-q\fP"
Be quiet.
-.TP
-.B \-v
+.IP "\fB\-v\fP"
Be verbose.
-.TP
-.B \-\-report
-Print a report for
-.IR devices .
-Note that the partition StartSec is in 512-byte sectors.
+.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
-.TP
-.B \--setro
-Set read-only.
-.TP
-.B \--setrw
-Set read-write.
-.TP
-.B \--getro
-Get read-only. Print 1 if the device is read-only, 0 otherwise.
-.TP
-.B \--getss
-Print sectorsize in bytes - usually 512.
-.TP
-.B \--getbsz
+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.
-.TP
-.BI \--setbsz " N"
-Set blocksize to
-.I N
-bytes.
-.TP
-.B \--getsize
-Print device size in sectors (BLKGETSIZE). Deprecated in favor of the
-.B \--getsz
-option.
-.TP
-.B \--getsize64
-Print device size in bytes (BLKGETSIZE64)
-.TP
-.B \--getsz
-Get size in 512-byte sectors (BLKGETSIZE64 / 512).
-.TP
-.BI \--setra " N"
-Set readahead to
-.I N
-512-byte sectors.
-.TP
-.B \--getra
+.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).
-.TP
-.BI \--setfra " N"
+.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"
+Seread 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).
-.TP
-.B \--getfra
-Get filesystem readahead.
-.TP
-.B \--flushbufs
-Flush buffers.
-.TP
-.B \--rereadpt
-Reread partition table.
+.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.
+blockdev was written by Andries E. Brouwer and rewrittent by Karel Zak.
.SH AVAILABILITY
The blockdev command is part of the util-linux-ng package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index 089405e9..27b1a0a2 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -109,7 +109,7 @@ struct bdc bdcms[] =
.name = "--getalignoff",
.argtype = ARG_INT,
.argval = -1,
- .help = N_("get alignment offset")
+ .help = N_("get alignment offset in bytes")
},{
IOCTL_ENTRY(BLKSECTGET),
.name = "--getmaxsect",
@@ -125,7 +125,7 @@ struct bdc bdcms[] =
},{
IOCTL_ENTRY(BLKBSZSET),
.name = "--setbsz",
- .argname = "BLOCKSIZE",
+ .argname = "<bytes>",
.argtype = ARG_INT,
.flags = FL_NORESULT,
.help = N_("set blocksize")
@@ -134,7 +134,7 @@ struct bdc bdcms[] =
.name = "--getsize",
.argtype = ARG_ULONG,
.argval = -1,
- .help = N_("get 32-bit sector count")
+ .help = N_("get 32-bit sector count (deprecated, use --getsz)")
},{
IOCTL_ENTRY(BLKGETSIZE64),
.name = "--getsize64",
@@ -144,7 +144,7 @@ struct bdc bdcms[] =
},{
IOCTL_ENTRY(BLKRASET),
.name = "--setra",
- .argname = "READAHEAD",
+ .argname = "<sectors>",
.argtype = ARG_INT,
.flags = FL_NOPTR | FL_NORESULT,
.help = N_("set readahead")
@@ -157,7 +157,7 @@ struct bdc bdcms[] =
},{
IOCTL_ENTRY(BLKFRASET),
.name = "--setfra",
- .argname = "FSREADAHEAD",
+ .argname = "<sectors>",
.argtype = ARG_INT,
.flags = FL_NOPTR | FL_NORESULT,
.help = N_("set filesystem readahead")