]>
Commit | Line | Data |
---|---|---|
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 | |
26 | sd \- 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 |
33 | The block device name has the following form: | |
34 | .BI sd lp, | |
35 | where | |
36 | .I l | |
37 | is a letter denoting the physical drive, and | |
38 | .I p | |
39 | is a number denoting the partition on that physical drive. Often, the | |
40 | partition number, | |
41 | .IR p , | |
42 | will be left off when the device corresponds to the whole drive. | |
43 | ||
44 | SCSI disks have a major device number of 8, and a minor device number of | |
45 | the form (16 * | |
46 | .IR drive_number ") + " partition_number , | |
47 | where | |
48 | .I drive_number | |
49 | is the number of the physical drive in order of detection, and | |
50 | .I partition_number | |
51 | is as follows: | |
52 | .sp | |
53 | partition 0 is the whole drive | |
54 | .br | |
55 | partitions 1-4 are the DOS "primary" partitions | |
56 | .br | |
57 | partitions 5-8 are the DOS "extended" (or "logical") partitions | |
58 | ||
59 | For example, | |
8478ee02 | 60 | .I /dev/sda |
fea681da MK |
61 | will have major 8, minor 0, and will refer to all of the first SCSI drive |
62 | in the system; and | |
8478ee02 | 63 | .I /dev/sdb3 |
fea681da MK |
64 | will have major 8, minor 19, and will refer to the third DOS "primary" |
65 | partition on the second SCSI drive in the system. | |
66 | ||
67 | At this time, only block devices are provided. Raw devices have not yet | |
68 | been implemented. | |
69 | .SH DESCRIPTION | |
70 | The following | |
71 | .IR ioctl s | |
72 | are provided: | |
73 | .TP | |
74 | HDIO_GETGEO | |
75 | .RS | |
76 | Returns the BIOS disk parameters in the following structure: | |
77 | .RS | |
78 | .nf | |
79 | .ft B | |
80 | struct 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 | ||
90 | A pointer to this structure is passed as the | |
91 | .BR ioctl (2) | |
92 | parameter. | |
93 | ||
94 | The information returned in the parameter is the disk geometry of the drive | |
95 | .I "as understood by DOS!" | |
96 | This geometry is | |
97 | .I not | |
98 | the physical geometry of the drive. It is used when constructing the | |
99 | drive's partition table, however, and is needed for convenient operation | |
100 | of | |
101 | .BR fdisk (1), | |
102 | .BR efdisk (1), | |
103 | and | |
104 | .BR lilo (1). | |
105 | If the geometry information is not available, zero will be returned for all | |
106 | of the parameters. | |
107 | .RE | |
108 | .TP | |
109 | BLKGETSIZE | |
110 | Returns the device size in sectors. The | |
111 | .BR ioctl (2) | |
112 | parameter should be a pointer to a | |
9ff08aad | 113 | .IR long . |
fea681da MK |
114 | .TP |
115 | BLKRRPART | |
116 | Forces a re-read of the SCSI disk partition tables. No parameter is needed. | |
117 | ||
118 | The | |
119 | .BR scsi (4) | |
fea681da | 120 | .BR ioctl (2) |
9ff08aad MK |
121 | operations are also supported. If the |
122 | .BR ioctl () | |
fea681da | 123 | parameter is required, and it is NULL, then |
31e9a9ec | 124 | .BR ioctl () |
4d9b6984 | 125 | will 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) |