2004-11-03 13:51:07 +00:00
|
|
|
.\" sd.4
|
|
|
|
.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
2007-05-30 05:43:37 +00:00
|
|
|
.TH SD 4 1992-12-17 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
sd \- Driver for SCSI Disk Drives
|
|
|
|
.SH SYNOPSIS
|
2006-12-27 04:27:15 +00:00
|
|
|
.nf
|
2007-12-23 08:20:39 +00:00
|
|
|
.BR "#include <linux/hdreg.h> " "/* for HDIO_GETGEO */"
|
|
|
|
.BR "#include <linux/fs.h> " "/* for BLKGETSIZE and BLKRRPART */"
|
2006-12-27 04:27:15 +00:00
|
|
|
.fi
|
2007-06-15 19:23:16 +00:00
|
|
|
.SH CONFIGURATION
|
2004-11-03 13:51:07 +00:00
|
|
|
The block device name has the following form:
|
|
|
|
.BI sd lp,
|
|
|
|
where
|
|
|
|
.I l
|
|
|
|
is a letter denoting the physical drive, and
|
|
|
|
.I p
|
2007-04-12 22:42:49 +00:00
|
|
|
is a number denoting the partition on that physical drive.
|
|
|
|
Often, the partition number,
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR p ,
|
|
|
|
will be left off when the device corresponds to the whole drive.
|
|
|
|
|
|
|
|
SCSI disks have a major device number of 8, and a minor device number of
|
|
|
|
the form (16 *
|
|
|
|
.IR drive_number ") + " partition_number ,
|
|
|
|
where
|
|
|
|
.I drive_number
|
|
|
|
is the number of the physical drive in order of detection, and
|
|
|
|
.I partition_number
|
|
|
|
is as follows:
|
|
|
|
.sp
|
|
|
|
partition 0 is the whole drive
|
|
|
|
.br
|
|
|
|
partitions 1-4 are the DOS "primary" partitions
|
|
|
|
.br
|
|
|
|
partitions 5-8 are the DOS "extended" (or "logical") partitions
|
|
|
|
|
|
|
|
For example,
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /dev/sda
|
2004-11-03 13:51:07 +00:00
|
|
|
will have major 8, minor 0, and will refer to all of the first SCSI drive
|
|
|
|
in the system; and
|
2005-11-02 13:55:25 +00:00
|
|
|
.I /dev/sdb3
|
2004-11-03 13:51:07 +00:00
|
|
|
will have major 8, minor 19, and will refer to the third DOS "primary"
|
|
|
|
partition on the second SCSI drive in the system.
|
|
|
|
|
2007-04-12 22:42:49 +00:00
|
|
|
At this time, only block devices are provided.
|
|
|
|
Raw devices have not yet been implemented.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The following
|
|
|
|
.IR ioctl s
|
|
|
|
are provided:
|
|
|
|
.TP
|
2007-12-16 13:49:24 +00:00
|
|
|
.B HDIO_GETGEO
|
2004-11-03 13:51:07 +00:00
|
|
|
.RS
|
|
|
|
Returns the BIOS disk parameters in the following structure:
|
2007-12-19 06:16:04 +00:00
|
|
|
.in +4n
|
2004-11-03 13:51:07 +00:00
|
|
|
.nf
|
2007-06-20 20:56:49 +00:00
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
struct hd_geometry {
|
2007-06-20 20:56:49 +00:00
|
|
|
unsigned char heads;
|
|
|
|
unsigned char sectors;
|
|
|
|
unsigned short cylinders;
|
|
|
|
unsigned long start;
|
2004-11-03 13:51:07 +00:00
|
|
|
};
|
|
|
|
.fi
|
2007-12-19 06:16:04 +00:00
|
|
|
.in
|
2004-11-03 13:51:07 +00:00
|
|
|
|
|
|
|
A pointer to this structure is passed as the
|
|
|
|
.BR ioctl (2)
|
|
|
|
parameter.
|
|
|
|
|
|
|
|
The information returned in the parameter is the disk geometry of the drive
|
|
|
|
.I "as understood by DOS!"
|
|
|
|
This geometry is
|
|
|
|
.I not
|
2007-04-12 22:42:49 +00:00
|
|
|
the physical geometry of the drive.
|
|
|
|
It is used when constructing the
|
2004-11-03 13:51:07 +00:00
|
|
|
drive's partition table, however, and is needed for convenient operation
|
|
|
|
of
|
|
|
|
.BR fdisk (1),
|
|
|
|
.BR efdisk (1),
|
|
|
|
and
|
|
|
|
.BR lilo (1).
|
|
|
|
If the geometry information is not available, zero will be returned for all
|
|
|
|
of the parameters.
|
|
|
|
.RE
|
|
|
|
.TP
|
2007-12-16 13:49:24 +00:00
|
|
|
.B BLKGETSIZE
|
2007-04-12 22:42:49 +00:00
|
|
|
Returns the device size in sectors.
|
|
|
|
The
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR ioctl (2)
|
|
|
|
parameter should be a pointer to a
|
2006-02-09 20:24:53 +00:00
|
|
|
.IR long .
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2007-12-16 13:49:24 +00:00
|
|
|
.B BLKRRPART
|
close.2, epoll_create.2, epoll_ctl.2, fcntl.2, madvise.2, mmap.2, mremap.2, select_tut.2, setgid.2, setuid.2, syscalls.2, vmsplice.2, dlopen.3, fts.3, getpw.3, stdio.3, fd.4, initrd.4, random.4, sd.4, bootparam.7, capabilities.7, cpuset.7, epoll.7, inotify.7, man.7, socket.7, x25.7: Global fix: s/re-/re/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "re-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 17:45:23 +00:00
|
|
|
Forces a reread of the SCSI disk partition tables.
|
2007-04-12 22:42:49 +00:00
|
|
|
No parameter is needed.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
|
|
|
The
|
|
|
|
.BR scsi (4)
|
|
|
|
.BR ioctl (2)
|
2007-04-12 22:42:49 +00:00
|
|
|
operations are also supported.
|
|
|
|
If the
|
2007-05-11 23:18:56 +00:00
|
|
|
.BR ioctl (2)
|
2004-11-03 13:51:07 +00:00
|
|
|
parameter is required, and it is NULL, then
|
2007-05-11 23:18:56 +00:00
|
|
|
.BR ioctl (2)
|
2007-06-23 08:13:42 +00:00
|
|
|
will fail with the error
|
|
|
|
.BR EINVAL .
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH FILES
|
2005-07-07 08:27:03 +00:00
|
|
|
/dev/sd[a\-h]: the whole device
|
2004-11-03 13:51:07 +00:00
|
|
|
.br
|
2005-07-07 08:27:03 +00:00
|
|
|
/dev/sd[a\-h][0\-8]: individual block partitions
|
2005-11-15 17:58:34 +00:00
|
|
|
.\".SH "SEE ALSO"
|
|
|
|
.\".BR scsi (4)
|