sd(4) — Linux manual page

NAME | SYNOPSIS | CONFIGURATION | DESCRIPTION | FILES | COLOPHON

sd(4)                   Kernel Interfaces Manual                   sd(4)

NAME         top

       sd - driver for SCSI disk drives

SYNOPSIS         top

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

CONFIGURATION         top

       The block device name has the following form: sdlp, where l is a
       letter denoting the physical drive, and p is a number denoting
       the partition on that physical drive.  Often, the partition
       number, p, will be left off when the device corresponds to the
       whole drive.

       SCSI disks have a major device number of 8, and a minor device
       number of the form (16 * drive_number) + partition_number, where
       drive_number is the number of the physical drive in order of
       detection, and partition_number is as follows:

       •  partition 0 is the whole drive

       •  partitions 1–4 are the DOS "primary" partitions

       •  partitions 5–8 are the DOS "extended" (or "logical")
          partitions

       For example, /dev/sda will have major 8, minor 0, and will refer
       to all of the first SCSI drive in the system; and /dev/sdb3 will
       have major 8, minor 19, and will refer to the third DOS "primary"
       partition on the second SCSI drive in the system.

       At this time, only block devices are provided.  Raw devices have
       not yet been implemented.

DESCRIPTION         top

       The following ioctls are provided:

       HDIO_GETGEO
              Returns the BIOS disk parameters in the following
              structure:

           struct hd_geometry {
               unsigned char  heads;
               unsigned char  sectors;
               unsigned short cylinders;
               unsigned long  start;
           };

              A pointer to this structure is passed as the ioctl(2)
              parameter.

              The information returned in the parameter is the disk
              geometry of the drive as understood by DOS!  This geometry
              is not the physical geometry of the drive.  It is used
              when constructing the drive's partition table, however,
              and is needed for convenient operation of fdisk(1),
              efdisk(1), and lilo(1).  If the geometry information is
              not available, zero will be returned for all of the
              parameters.

       BLKGETSIZE
              Returns the device size in sectors.  The ioctl(2)
              parameter should be a pointer to a long.

       BLKRRPART
              Forces a reread of the SCSI disk partition tables.  No
              parameter is needed.

              The SCSI ioctl(2) operations are also supported.  If the
              ioctl(2) parameter is required, and it is NULL, then
              ioctl(2) fails with the error EINVAL.

FILES         top

       /dev/sd[a-h]
              the whole device

       /dev/sd[a-h][0-8]
              individual block partitions

COLOPHON         top

       This page is part of the man-pages (Linux kernel and C library
       user-space interface documentation) project.  Information about
       the project can be found at 
       ⟨https://www.kernel.org/doc/man-pages/⟩.  If you have a bug report
       for this manual page, see
       ⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩.
       This page was obtained from the tarball man-pages-6.9.1.tar.gz
       fetched from
       ⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on
       2024-06-26.  If you discover any rendering problems in this HTML
       version of the page, or you believe there is a better or more up-
       to-date source for the page, or you have corrections or
       improvements to the information in this COLOPHON (which is not
       part of the original manual page), send a mail to
       man-pages@man7.org

Linux man-pages 6.9.1          2024-05-02                          sd(4)

Pages that refer to this page: ioctl(2)ioctl_console(2)hd(4)hpsa(4)smartpqi(4)