1SD(4)                      Linux Programmer's Manual                     SD(4)
2
3
4

NAME

6       sd - Driver for SCSI Disk Drives
7

SYNOPSIS

9       #include <linux/hdreg.h>        /* for HDIO_GETGEO */
10       #include <linux/fs.h>           /* for BLKGETSIZE and BLKRRPART */
11

CONFIG

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

DESCRIPTION

36       The following ioctls are provided:
37
38       HDIO_GETGEO
39              Returns the BIOS disk parameters in the following structure:
40                     struct hd_geometry {
41                           unsigned char heads;
42                           unsigned char sectors;
43                           unsigned short cylinders;
44                           unsigned long start;
45                     };
46
47              A pointer to this structure is passed as the ioctl(2) parameter.
48
49              The  information  returned in the parameter is the disk geometry
50              of the drive as understood by DOS!  This  geometry  is  not  the
51              physical  geometry  of  the drive.  It is used when constructing
52              the drive's partition table, however, and is needed  for  conve‐
53              nient  operation  of  fdisk(1),  efdisk(1), and lilo(1).  If the
54              geometry information is not available, zero will be returned for
55              all of the parameters.
56
57       BLKGETSIZE
58              Returns  the  device  size  in  sectors.  The ioctl(2) parameter
59              should be a pointer to a long.
60
61       BLKRRPART
62              Forces a re-read of the SCSI disk partition tables.  No  parame‐
63              ter is needed.
64
65              The  scsi(4)  ioctl(2)  operations  are  also supported.  If the
66              ioctl() parameter is required, and it is NULL, then ioctl() will
67              return -EINVAL.
68

FILES

70       /dev/sd[a-h]: the whole device
71       /dev/sd[a-h][0-8]: individual block partitions
72
73
74
75                                  1992-12-17                             SD(4)
Impressum