Device File - Linux Naming Conventions

Linux Naming Conventions

The following prefixes have come into common use in Linux-based systems, to identify the type of a device driver interface in the /dev hierarchy:

  • fb: frame buffer
  • fd: (platform) floppy disks, though this same abbreviation is also commonly used to refer to file descriptor
  • hd: (“classic”) IDE driver (previously used for ATA hard disk drive, ATAPI optical disc drives, etc.)
    • hda: the master device on the first ATA channel (usually identified by major number 3 and minor number 0)
    • hdb: the slave device on the first ATA channel
    • hdc: the master device on the second ATA channel
      • hdc1: first partition on this disk (example)
      • hdc5: first logical drive in the extended partition (example)
    • hdd: the slave device on the second ATA channel
  • lp: line printers (compare lp)
  • parport, pp: parallel ports
  • pt: pseudo-terminals (virtual terminals)
  • SCSI driver, also used by libATA (modern PATA/SATA driver), USB, IEEE 1394, etc.
    • sd: mass-storage driver
      • sda: first registered device
        • sda4: last partition on this disk (example)
        • sda6: second logical drive in the extended partition (example)
    • ses: Enclosure driver
    • sg: generic SCSI layer
    • sr: “ROM” driver (data-oriented optical disc drives; scd is just a secondary alias)
    • st: magnetic tape driver
  • tty: terminals
    • ttyS: (platform) serial port driver
    • ttyUSB: USB serial converters, modems, etc.

The canonical list of these prefixes can be found in the Linux Device List, the official registry of allocated device numbers and /dev directory nodes for the Linux operating system.

For most devices, this prefix is followed by a number uniquely identifying the particular device. For hard drives, a letter is used to identify devices and is followed by a number to identify partitions. Thus a file system may "know" an area on a disk as /dev/sda3, for example, or "see" a networked terminal session as associated with /dev/pts/14.

On disks using the typical PC master boot record, the device numbers of primary and the optional extended partition are numbered 1 through 4, while the indexes of any logical partitions are 5 and onwards, regardless of the layout of the former partitions (their parent extended partition does not need to be the fourth partition on the disk, nor do all four primary partitions have to exist).

Device names are usually not portable between different Unix-like system variants, for example, on some BSD systems, the IDE devices are named /dev/wd0, /dev/wd1, etc.

Read more about this topic:  Device File

Famous quotes containing the words naming and/or conventions:

    Husband,
    who am I to reject the naming of foods
    in a time of famine?
    Anne Sexton (1928–1974)

    I find nothing healthful or exalting in the smooth conventions of society. I do not like the close air of saloons. I begin to suspect myself to be a prisoner, though treated with all this courtesy and luxury. I pay a destructive tax in my conformity.
    Ralph Waldo Emerson (1803–1882)