hd(HW) 19 June 1992 hd(HW) Name hd - internal hard disk drive Description Block-buffered access to the primary hard disk is provided through the following block special files: hd00, hd01 through hd04, hd0a and hd0d, root, and swap. Block-buffered access to the secondary hard disk is pro- vided through the following block special files: hd10, hd11 through hd14, hd1a. hd00 refers to the entire physical disk; hd01 through hd04 refer to the fdisk partitions. root refers to the root file system; swap refers to the swap area; the block special files access the disks via the system's nor- mal buffering mechanism and may be read and written without regard to the size of physical disk records. Character special files follow the same naming convention as the block special files except that the character special file is prefaced with an ``r'' (for ``raw'' or character device). For example, the character spe- cial file referring to the entire physical disk is /dev/rhd00. The following are example names of the fixed disk partitions. Each partition can be accessed through a block interface, for example /dev/hd01, or through a character (raw) interface, for example /dev/rhd01. The above devices follow the XENIX naming convention. Equivalent UNIX devices are found in the /dev/dsk (character) and /dev/rdsk (raw) direc- tories. In the table that follows, both XENIX and UNIX devices are shown. XENIX devices extend only to disks located on the first control- ler; beyond this, the UNIX devices shown must be used. Device File Names for Fixed Disks _________________________________________________________________________ First Controller Disk 1 Disk 2 Partition _________________________________________________________________________ /dev/hd00 /dev/hd10 entire disk /dev/rhd00 /dev/rhd10 /dev/hd01 /dev/hd11 first partition /dev/rhd01 /dev/rhd11 /dev/hd02 /dev/hd12 second partition /dev/rhd02 /dev/rhd12 /dev/hd03 /dev/hd13 third partition /dev/rhd03 /dev/rhd13 /dev/hd04 /dev/hd14 fourth partition /dev/rhd04 /dev/rhd14 /dev/hd0a /dev/hd1a active partition /dev/rhd0a /dev/rhd1a /dev/root root file system /dev/rroot /dev/swap swap area /dev/rswap Note that the root and swap files exist only for the root disk. The following table lists the minor device number definitions for the hard disk special files, along with examples. Note that the block and character special devices share the same minor device definition. The minor device number definition is as follows: bits 7 and 6 denote physi- cal drive, bits 5-3 denote virtual (fdisk) partition and bits 2-0 denote divvy partition. Because some SCSI controllers support large numbers of physical drives, an extended minor device numbering scheme is provided for those devices requiring more than 256 minor numbers. Each driver that uses extended minor numbers has a base major number which is used to refer to the driver through the extended minor numbers. The driver has a normal entry in the mdevice table for the base major number, plus one additional entry for each group of 256 minor devices that the driver uses. Additional entries are identified by the ``M'' flag in the driver's de- vice characteristics field. The ``M'' flag indicates that the entry cor- responds to a virtual major number that points to a device driver that uses extended minor numbers. Therefore a very large disk may sometimes have two (or more) major numbers; the first will correspond to minor num- bers 0-255, the second to minor devices 256-512, and so on. The minor device bits for DOS disk special files are listed in a separate table. Minor Device Bits _________________________________________________________________________ Phys. Virtual divvy Device special Description 7 6 5 4 3 2 1 0 file name _________________________________________________________________________ 0 0 0 0 0 0 0 0 /dev/hd00 whole PD 0 0 1 0 0 0 0 0 0 /dev/hd10 whole PD 1 1 0 0 0 0 0 0 0 /dev/dsk/4s0 whole PD 2 1 1 0 0 0 0 0 0 /dev/dsk/5s0 whole PD 3 0 0 0 0 1 1 1 1 /dev/hd01 PD 0, whole VD 1 0 0 0 1 0 1 1 1 /dev/hd02 PD 0, whole VD 2 0 0 0 1 1 1 1 1 /dev/hd03 PD 0, whole VD 3 0 0 1 0 0 1 1 1 /dev/hd04 PD 0, whole VD 4 0 0 1 0 1 1 1 1 /dev/hd0a PD 0, whole active VD 0 0 1 0 1 0 0 0 /dev/root PD 0, active virtual, DP 0 0 0 1 0 1 0 0 1 /dev/swap PD 0, active virtual, DP 1 0 0 1 0 1 0 1 0 /dev/usr PD 0, active virtual, DP 2 0 0 1 0 1 1 1 0 /dev/recover PD 0, active virtual, DP 6 0 1 0 0 1 1 1 1 /dev/hd11 PD 1, whole VD 1 0 1 0 1 0 1 1 1 /dev/hd12 PD 1, whole VD 2 0 1 0 1 1 1 1 1 /dev/hd13 PD 1, whole VD 3 0 1 1 0 0 1 1 1 /dev/hd14 PD 1, whole VD 4 0 1 1 0 1 1 1 1 /dev/hd1a PD 1, whole active VD 0 1 1 0 1 0 0 0 /dev/u0 PD 1, active virtual, DP 0* 0 1 1 0 1 0 0 1 /dev/u1 PD 1, active virtual, DP 1* 0 1 1 0 1 0 1 0 /dev/u2 PD 1, active virtual, DP 2* 1 0 0 0 1 1 1 1 /dev/dsk/2s1 PD 2, whole VD 1 1 0 0 1 0 1 1 1 /dev/dsk/2s2 PD 2, whole VD 2 1 0 0 1 1 1 1 1 /dev/dsk/2s3 PD 2, whole VD 3 1 0 1 0 0 1 1 1 /dev/dsk/2s4 PD 2, whole VD 4 1 0 1 0 1 1 1 1 /dev/dsk/2sa PD 2, whole active VD 1 1 0 0 1 1 1 1 /dev/dsk/3s1 PD 3, whole VD 1 1 1 0 1 0 1 1 1 /dev/dsk/3s2 PD 3, whole VD 2 1 1 0 1 1 1 1 1 /dev/dsk/3s3 PD 3, whole VD 3 1 1 1 0 0 1 1 1 /dev/dsk/3s4 PD 3, whole VD 4 1 1 1 0 1 1 1 1 /dev/dsk/3sa PD 3, whole active VD Key VD = virtual drive PD = physical drive DP = divvy partition * = user-defined name The device files usr and u[0-2] are optional filesystem names; these nodes are not present unless created by the system administrator. DOS Minor Device Bits _________________________________________________________________________ Phys. Virtual divvy Device special Description 7 6 5 4 3 2 1 0 file name _________________________________________________________________________ 0 0 1 1 0 0 0 0 /dev/dsk/0sC PD 0, PDP, logical drive C 0 0 1 1 0 0 0 1 /dev/dsk/0sD PD 0, EDP, logical drive D 0 0 1 1 0 0 1 0 /dev/dsk/0sE PD 0, EDP, logical drive E 0 0 1 1 0 0 1 1 /dev/dsk/0sF PD 0, EDP, logical drive F 0 0 1 1 0 1 0 0 /dev/dsk/0sG PD 0, EDP, logical drive G 0 0 1 1 0 1 0 1 /dev/dsk/0sH PD 0, EDP, logical drive H 0 0 1 1 0 1 1 0 /dev/dsk/0sI PD 0, EDP, logical drive I 0 0 1 1 0 1 1 1 /dev/dsk/0sJ PD 0, EDP, logical drive J 0 1 1 1 0 0 0 0 /dev/dsk/1sC PD 1, PDP, logical drive C 0 1 1 1 0 0 0 1 /dev/dsk/1sD PD 1, EDP, logical drive D 0 1 1 1 0 0 1 0 /dev/dsk/1sE PD 1, EDP, logical drive E 0 1 1 1 0 0 1 1 /dev/dsk/1sF PD 1, EDP, logical drive F 0 1 1 1 0 1 0 0 /dev/dsk/1sG PD 1, EDP, logical drive G 0 1 1 1 0 1 0 1 /dev/dsk/1sH PD 1, EDP, logical drive H 0 1 1 1 0 1 1 0 /dev/dsk/1sI PD 1, EDP, logical drive I 0 1 1 1 0 1 1 1 /dev/dsk/1sJ PD 1, EDP, logical drive J 1 0 1 1 0 0 0 0 /dev/dsk/2sC PD 2, PDP, logical drive C 1 0 1 1 0 0 0 1 /dev/dsk/2sD PD 2, EDP, logical drive D 1 0 1 1 0 0 1 0 /dev/dsk/2sE PD 2, EDP, logical drive E 1 0 1 1 0 0 1 1 /dev/dsk/2sF PD 2, EDP, logical drive F 1 0 1 1 0 1 0 0 /dev/dsk/2sG PD 2, EDP, logical drive G 1 0 1 1 0 1 0 1 /dev/dsk/2sH PD 2, EDP, logical drive H 1 0 1 1 0 1 1 0 /dev/dsk/2sI PD 2, EDP, logical drive I 1 0 1 1 0 1 1 1 /dev/dsk/2sJ PD 2, EDP, logical drive J 1 1 1 1 0 0 0 0 /dev/dsk/3sC PD 3, PDP, logical drive C 1 1 1 1 0 0 0 1 /dev/dsk/3sD PD 3, EDP, logical drive D 1 1 1 1 0 0 1 0 /dev/dsk/3sE PD 3, EDP, logical drive E 1 1 1 1 0 0 1 1 /dev/dsk/3sF PD 3, EDP, logical drive F 1 1 1 1 0 1 0 0 /dev/dsk/3sG PD 3, EDP, logical drive G 1 1 1 1 0 1 0 1 /dev/dsk/3sH PD 3, EDP, logical drive H 1 1 1 1 0 1 1 0 /dev/dsk/3sI PD 3, EDP, logical drive I 1 1 1 1 0 1 1 1 /dev/dsk/3sJ PD 3, EDP, logical drive J Key PDP = primary DOS partition EDP = extended DOS partition The device file /dev/hd0d (first DOS partition) is linked to /dev/dsk/0sC for backwards compatibility. To access DOS partitions, specify letters such as ``C:'' or ``D:'' to indicate first or second partitions. The file /etc/default/msdos con- tains lines that assign a letter abbreviation for the DOS device name. Refer to dos(C). See also badtrk(ADM), divvy(ADM), dos(C), fdisk(ADM), mkdev(ADM), mknod(C) Diagnostics The following messages are among those that may be printed on the con- sole: invalid fixed disk parameter table and: error on fixed disk (minor n), block = nnnnn, cmd=nnnnn, status=nnnn, Sector = nnnnn, Cylinder/head = nnnnn Possible reasons for the first error include: - The kernel is unable to get drive specifications, such as number of heads, cylinders, and sectors per track, from the disk controller ROM. - Improper configuration. - The disk is not turned on. - The disk is not supported. The second error specifies the following information: - block: The UNIX block number within the device. - cmd: The last command sent to the disk controller. - status: The error status from the disk controller. - Sector and Cylinder/head specify the location of a possible flaw. This information is used with badtrk(ADM). Notes On the first disk, hd00 denotes the entire disk and is used to access the master boot block which includes the fdisk partition table. For the second disk, hd10 denotes the entire disk and is used to access its fdisk partition table. Do not write to hd10 and hd00.