]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/sd.4
Reformatted headings.
[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
fea681da
MK
29#include <linux/hdreg.h> /* for HDIO_GETGEO */
30#include <linux/fs.h> /* for BLKGETSIZE and BLKRRPART */
45ce2268 31.fi
fea681da
MK
32.SH CONFIG
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
74HDIO_GETGEO
75.RS
76Returns the BIOS disk parameters in the following structure:
77.RS
78.nf
79.ft B
80struct hd_geometry {
81 unsigned char heads;
82 unsigned char sectors;
83 unsigned short cylinders;
84 unsigned long start;
85};
86.ft R
87.fi
88.RE
89
90A pointer to this structure is passed as the
91.BR ioctl (2)
92parameter.
93
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.
108.RE
109.TP
110BLKGETSIZE
c13182ef
MK
111Returns the device size in sectors.
112The
fea681da
MK
113.BR ioctl (2)
114parameter should be a pointer to a
9ff08aad 115.IR long .
fea681da
MK
116.TP
117BLKRRPART
c13182ef
MK
118Forces a re-read of the SCSI disk partition tables.
119No parameter is needed.
fea681da
MK
120
121The
122.BR scsi (4)
fea681da 123.BR ioctl (2)
c13182ef
MK
124operations are also supported.
125If the
5e21af3a 126.BR ioctl (2)
fea681da 127parameter is required, and it is NULL, then
5e21af3a 128.BR ioctl (2)
4d9b6984 129will return \-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)