]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man4/sd.4
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man4 / sd.4
1 .\" sd.4
2 .\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH sd 4 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 sd \- driver for SCSI disk drives
9 .SH SYNOPSIS
10 .nf
11 .BR "#include <linux/hdreg.h> " "/* for HDIO_GETGEO */"
12 .BR "#include <linux/fs.h> " "/* for BLKGETSIZE and BLKRRPART */"
13 .fi
14 .SH CONFIGURATION
15 The block device name has the following form:
16 .BI sd lp,
17 where
18 .I l
19 is a letter denoting the physical drive, and
20 .I p
21 is a number denoting the partition on that physical drive.
22 Often, the partition number,
23 .IR p ,
24 will be left off when the device corresponds to the whole drive.
25 .PP
26 SCSI disks have a major device number of 8, and a minor device number of
27 the form (16 *
28 .IR drive_number ") + " partition_number ,
29 where
30 .I drive_number
31 is the number of the physical drive in order of detection, and
32 .I partition_number
33 is as follows:
34 .IP \(bu 3
35 partition 0 is the whole drive
36 .IP \(bu
37 partitions 1\(en4 are the DOS "primary" partitions
38 .IP \(bu
39 partitions 5\(en8 are the DOS "extended" (or "logical") partitions
40 .PP
41 For example,
42 .I /dev/sda
43 will have major 8, minor 0, and will refer to all of the first SCSI drive
44 in the system; and
45 .I /dev/sdb3
46 will have major 8, minor 19, and will refer to the third DOS "primary"
47 partition on the second SCSI drive in the system.
48 .PP
49 At this time, only block devices are provided.
50 Raw devices have not yet been implemented.
51 .SH DESCRIPTION
52 The following
53 .IR ioctl s
54 are provided:
55 .TP
56 .B HDIO_GETGEO
57 Returns the BIOS disk parameters in the following structure:
58 .PP
59 .in +4n
60 .EX
61 struct hd_geometry {
62 unsigned char heads;
63 unsigned char sectors;
64 unsigned short cylinders;
65 unsigned long start;
66 };
67 .EE
68 .in
69 .IP
70 A pointer to this structure is passed as the
71 .BR ioctl (2)
72 parameter.
73 .IP
74 The information returned in the parameter is the disk geometry of the drive
75 .I "as understood by DOS!"
76 This geometry is
77 .I not
78 the physical geometry of the drive.
79 It is used when constructing the
80 drive's partition table, however, and is needed for convenient operation
81 of
82 .BR fdisk (1),
83 .BR efdisk (1),
84 and
85 .BR lilo (1).
86 If the geometry information is not available, zero will be returned for all
87 of the parameters.
88 .TP
89 .B BLKGETSIZE
90 Returns the device size in sectors.
91 The
92 .BR ioctl (2)
93 parameter should be a pointer to a
94 .IR long .
95 .TP
96 .B BLKRRPART
97 Forces a reread of the SCSI disk partition tables.
98 No parameter is needed.
99 .IP
100 The SCSI
101 .BR ioctl (2)
102 operations are also supported.
103 If the
104 .BR ioctl (2)
105 parameter is required, and it is NULL, then
106 .BR ioctl (2)
107 fails with the error
108 .BR EINVAL .
109 .SH FILES
110 .TP
111 .I /dev/sd[a\-h]
112 the whole device
113 .TP
114 .I /dev/sd[a\-h][0\-8]
115 individual block partitions
116 .\".SH SEE ALSO
117 .\".BR scsi (4)