1SD(4) Linux Programmer's Manual SD(4)
2
3
4
6 sd - driver for SCSI disk drives
7
9 #include <linux/hdreg.h> /* for HDIO_GETGEO */
10 #include <linux/fs.h> /* for BLKGETSIZE and BLKRRPART */
11
13 The block device name has the following form: sdlp, where l is a letter
14 denoting the physical drive, and p is a number denoting the partition
15 on that physical drive. Often, the partition number, p, will be left
16 off when the device corresponds to the whole drive.
17
18 SCSI disks have a major device number of 8, and a minor device number
19 of the form (16 * drive_number) + partition_number, where drive_number
20 is the number of the physical drive in order of detection, and parti‐
21 tion_number is as follows:
22
23 partition 0 is the whole drive
24 partitions 1-4 are the DOS "primary" partitions
25 partitions 5-8 are the DOS "extended" (or "logical") partitions
26
27 For example, /dev/sda will have major 8, minor 0, and will refer to all
28 of the first SCSI drive in the system; and /dev/sdb3 will have major 8,
29 minor 19, and will refer to the third DOS "primary" partition on the
30 second SCSI drive in the system.
31
32 At this time, only block devices are provided. Raw devices have not
33 yet been implemented.
34
36 The following ioctls are provided:
37
38 HDIO_GETGEO
39 Returns the BIOS disk parameters in the following structure:
40
41 struct hd_geometry {
42 unsigned char heads;
43 unsigned char sectors;
44 unsigned short cylinders;
45 unsigned long start;
46 };
47
48 A pointer to this structure is passed as the ioctl(2) parameter.
49
50 The information returned in the parameter is the disk geometry
51 of the drive as understood by DOS! This geometry is not the
52 physical geometry of the drive. It is used when constructing
53 the drive's partition table, however, and is needed for conve‐
54 nient operation of fdisk(1), efdisk(1), and lilo(1). If the
55 geometry information is not available, zero will be returned for
56 all of the parameters.
57
58 BLKGETSIZE
59 Returns the device size in sectors. The ioctl(2) parameter
60 should be a pointer to a long.
61
62 BLKRRPART
63 Forces a reread of the SCSI disk partition tables. No parameter
64 is needed.
65
66 The SCSI ioctl(2) operations are also supported. If the
67 ioctl(2) parameter is required, and it is NULL, then ioctl(2)
68 will fail with the error EINVAL.
69
71 /dev/sd[a-h]: the whole device
72 /dev/sd[a-h][0-8]: individual block partitions
73
75 This page is part of release 3.53 of the Linux man-pages project. A
76 description of the project, and information about reporting bugs, can
77 be found at http://www.kernel.org/doc/man-pages/.
78
79
80
81Linux 2012-05-03 SD(4)