2006-12-06 17:25:44 -06:00
|
|
|
.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
|
2007-06-29 05:06:58 -05:00
|
|
|
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
|
2006-12-06 17:25:44 -06:00
|
|
|
.\"
|
|
|
|
.\" May be distributed under the GNU General Public License
|
2011-08-18 15:18:34 -05:00
|
|
|
.TH BLOCKDEV 8 "August 2010" "util-linux" "System Administration"
|
2006-12-06 17:25:44 -06:00
|
|
|
.SH NAME
|
|
|
|
blockdev \- call block device ioctls from the command line
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B blockdev
|
2010-08-24 05:59:41 -05:00
|
|
|
.RB [ \-q ]
|
|
|
|
.RB [ \-v ]
|
2014-04-02 18:23:32 -05:00
|
|
|
.I command
|
|
|
|
.RI [ command \&...\&]
|
|
|
|
.I device
|
|
|
|
.RI [ device \&...\&]
|
2007-09-10 04:25:10 -05:00
|
|
|
.br
|
|
|
|
.B blockdev
|
2009-07-22 04:29:04 -05:00
|
|
|
.B \-\-report
|
2014-04-02 18:23:32 -05:00
|
|
|
.RI [ device \&...\&]
|
2017-06-25 13:43:44 -05:00
|
|
|
.br
|
|
|
|
.B blockdev
|
2020-09-26 11:15:42 -05:00
|
|
|
.BR \-h | \-V
|
2006-12-06 17:25:44 -06:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The utility
|
|
|
|
.B blockdev
|
|
|
|
allows one to call block device ioctls from the command line.
|
|
|
|
.SH OPTIONS
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-q\fP"
|
2006-12-06 17:25:44 -06:00
|
|
|
Be quiet.
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-v\fP"
|
2006-12-06 17:25:44 -06:00
|
|
|
Be verbose.
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-\-report\fP"
|
|
|
|
Print a report for the specified device. It is possible to give multiple
|
2020-07-24 05:06:07 -05:00
|
|
|
devices. If none is given, all devices which appear in
|
|
|
|
.I /proc/partitions
|
|
|
|
are
|
2010-08-24 05:59:41 -05:00
|
|
|
shown. Note that the partition StartSec is in 512-byte sectors.
|
2017-06-25 13:43:44 -05:00
|
|
|
.IP "\fB\-h\fR, \fB\-\-help\fR"
|
|
|
|
Display help text and exit.
|
|
|
|
.IP "\fB\-V\fR, \fB\-\-version\fR"
|
|
|
|
Print version and exit.
|
2006-12-06 17:25:44 -06:00
|
|
|
.SH COMMANDS
|
2010-08-24 05:59:41 -05:00
|
|
|
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"
|
2020-07-24 05:06:07 -05:00
|
|
|
Print the blocksize in bytes.
|
|
|
|
This size does not describe device topology. It's
|
2020-08-27 10:12:45 -05:00
|
|
|
the size used internally by the kernel and it may be modified (for example) by
|
2019-02-28 07:08:23 -06:00
|
|
|
filesystem driver on mount.
|
2010-08-24 05:59:41 -05:00
|
|
|
.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"
|
2006-12-06 17:25:44 -06:00
|
|
|
Print readahead (in 512-byte sectors).
|
2010-08-24 05:59:41 -05:00
|
|
|
.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"
|
2020-07-24 05:06:07 -05:00
|
|
|
Print device size (32-bit!) in sectors. Deprecated in favor of the
|
|
|
|
.B \-\-getsz
|
|
|
|
option.
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-\-getss\fP"
|
2017-11-13 05:15:17 -06:00
|
|
|
Print logical sector size in bytes \(en usually 512.
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-\-getsz\fP"
|
|
|
|
Get size in 512-byte sectors.
|
|
|
|
.IP "\fB\-\-rereadpt\fP"
|
2011-01-05 13:54:19 -06:00
|
|
|
Reread partition table
|
2013-10-11 04:05:45 -05:00
|
|
|
.IP "\fB\-\-setbsz\fP \fIbytes\fP"
|
2013-10-11 04:16:23 -05:00
|
|
|
Set blocksize. Note that the block size is specific to the current file
|
|
|
|
descriptor opening the block device, so the change of block size only persists
|
2020-07-24 05:06:07 -05:00
|
|
|
for as long as
|
|
|
|
.B blockdev
|
|
|
|
has the device open, and is lost once
|
|
|
|
.B blockdev
|
|
|
|
exits.
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-\-setfra\fP \fIsectors\fP"
|
2020-07-24 05:06:07 -05:00
|
|
|
Set filesystem readahead (same as
|
|
|
|
.B \-\-setra
|
|
|
|
on 2.6 kernels).
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-\-setra\fP \fIsectors\fP"
|
|
|
|
Set readahead (in 512-byte sectors).
|
|
|
|
.IP "\fB\-\-setro\fP"
|
2020-07-24 05:06:07 -05:00
|
|
|
Set read-only. The currently active access to the device may not be affected by the change. For example,
|
|
|
|
a filesystem already mounted in read-write mode will not be affected.
|
|
|
|
The change applies after remount.
|
2010-08-24 05:59:41 -05:00
|
|
|
.IP "\fB\-\-setrw\fP"
|
|
|
|
Set read-write.
|
2020-05-19 07:51:28 -05:00
|
|
|
.SH AUTHORS
|
2014-04-02 18:23:32 -05:00
|
|
|
blockdev was written by Andries E.\& Brouwer and rewritten by Karel Zak.
|
2007-06-29 05:06:58 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The blockdev command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|