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