]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/sd.4
rename.2: SEE ALSO: add rename(1)
[thirdparty/man-pages.git] / man4 / sd.4
CommitLineData
fea681da
MK
1.\" sd.4
2.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
c13182ef 13.\"
fea681da
MK
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
c13182ef 21.\"
fea681da
MK
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
fea681da 25.\"
4b8c67d9 26.TH SD 4 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da 27.SH NAME
f68512e9 28sd \- driver for SCSI disk drives
fea681da 29.SH SYNOPSIS
45ce2268 30.nf
62218dc0
MK
31.BR "#include <linux/hdreg.h> " "/* for HDIO_GETGEO */"
32.BR "#include <linux/fs.h> " "/* for BLKGETSIZE and BLKRRPART */"
45ce2268 33.fi
35490a1f 34.SH CONFIGURATION
fea681da
MK
35The block device name has the following form:
36.BI sd lp,
37where
38.I l
39is a letter denoting the physical drive, and
40.I p
c13182ef
MK
41is a number denoting the partition on that physical drive.
42Often, the partition number,
fea681da
MK
43.IR p ,
44will be left off when the device corresponds to the whole drive.
5b539973 45.PP
fea681da
MK
46SCSI disks have a major device number of 8, and a minor device number of
47the form (16 *
48.IR drive_number ") + " partition_number ,
49where
50.I drive_number
51is the number of the physical drive in order of detection, and
52.I partition_number
53is as follows:
bdd915e2 54.IP +3
fea681da 55partition 0 is the whole drive
bdd915e2 56.IP
d2fdb1e3 57partitions 1\(en4 are the DOS "primary" partitions
bdd915e2 58.IP
9bc87ed0 59partitions 5\(en8 are the DOS "extended" (or "logical") partitions
5b539973 60.PP
fea681da 61For example,
8478ee02 62.I /dev/sda
fea681da
MK
63will have major 8, minor 0, and will refer to all of the first SCSI drive
64in the system; and
8478ee02 65.I /dev/sdb3
fea681da
MK
66will have major 8, minor 19, and will refer to the third DOS "primary"
67partition on the second SCSI drive in the system.
5b539973 68.PP
c13182ef
MK
69At this time, only block devices are provided.
70Raw devices have not yet been implemented.
fea681da
MK
71.SH DESCRIPTION
72The following
73.IR ioctl s
74are provided:
75.TP
08362d55 76.B HDIO_GETGEO
fea681da 77Returns the BIOS disk parameters in the following structure:
bdd915e2 78.PP
bd191423 79.in +4n
bdd915e2 80.EX
fea681da 81struct hd_geometry {
de99e9e3
MK
82 unsigned char heads;
83 unsigned char sectors;
84 unsigned short cylinders;
85 unsigned long start;
fea681da 86};
bdd915e2 87.EE
bd191423 88.in
5b539973 89.IP
fea681da
MK
90A pointer to this structure is passed as the
91.BR ioctl (2)
92parameter.
5b539973 93.IP
fea681da
MK
94The information returned in the parameter is the disk geometry of the drive
95.I "as understood by DOS!"
96This geometry is
97.I not
c13182ef
MK
98the physical geometry of the drive.
99It is used when constructing the
fea681da
MK
100drive's partition table, however, and is needed for convenient operation
101of
102.BR fdisk (1),
103.BR efdisk (1),
104and
105.BR lilo (1).
106If the geometry information is not available, zero will be returned for all
107of the parameters.
fea681da 108.TP
08362d55 109.B BLKGETSIZE
c13182ef
MK
110Returns the device size in sectors.
111The
fea681da
MK
112.BR ioctl (2)
113parameter should be a pointer to a
9ff08aad 114.IR long .
fea681da 115.TP
08362d55 116.B BLKRRPART
3b777aff 117Forces a reread of the SCSI disk partition tables.
c13182ef 118No parameter is needed.
5b539973 119.IP
fce95f40 120The SCSI
fea681da 121.BR ioctl (2)
c13182ef
MK
122operations are also supported.
123If the
5e21af3a 124.BR ioctl (2)
fea681da 125parameter is required, and it is NULL, then
5e21af3a 126.BR ioctl (2)
a23d8efa 127fails with the error
b7d35dc7 128.BR EINVAL .
fea681da 129.SH FILES
41201388
MK
130.TP
131.I /dev/sd[a\-h]
132the whole device
133.TP
134.I /dev/sd[a\-h][0\-8]
135individual block partitions
d282bb24 136.\".SH SEE ALSO
6a883c81 137.\".BR scsi (4)