]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/sd.4
sync
[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.
12.\"
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.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\"
24.TH SD 4 1992-12-17 "" "Linux Programmer's Manual"
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
39is a number denoting the partition on that physical drive. Often, the
40partition number,
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
67At this time, only block devices are provided. Raw devices have not yet
68been implemented.
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
98the physical geometry of the drive. It is used when constructing the
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
109BLKGETSIZE
110Returns the device size in sectors. The
111.BR ioctl (2)
112parameter should be a pointer to a
9ff08aad 113.IR long .
fea681da
MK
114.TP
115BLKRRPART
116Forces a re-read of the SCSI disk partition tables. No parameter is needed.
117
118The
119.BR scsi (4)
fea681da 120.BR ioctl (2)
9ff08aad
MK
121operations are also supported. If the
122.BR ioctl ()
fea681da 123parameter is required, and it is NULL, then
31e9a9ec 124.BR ioctl ()
4d9b6984 125will return \-EINVAL.
fea681da 126.SH FILES
8c383102 127/dev/sd[a\-h]: the whole device
fea681da 128.br
8c383102 129/dev/sd[a\-h][0\-8]: individual block partitions
6a883c81
MK
130.\".SH "SEE ALSO"
131.\".BR scsi (4)