153

What does

/dev/sda

stand for? What does it mean?

I have both Fedora and Ubuntu installed and if I explore them using Ext2explore from Windows, I see these names:

/dev/sda6
/dev/sda9

Please explain to me what that means. I'm referring to the numbers and also the /dev/sda/ part.

3 Answers 3

213
+50

TL;DR: It has to do with the way Linux (and other Unixes as well) name their drives, much in the way that Windows uses C:, D:, etc. (NOTE: This is what we call a metaphor. In other words, a blatant lie that helps people understand without being even remotely accurate. Read on for a more detailed explanation...)

  • /dev/ is the part in the Unix directory tree that contains all "device" files -- Unix traditionally treats just about everything you can access as a file to read from or write to.

  • sd originally identified a SCSI device, but since the proliferation of USB (and other removable) data carriers, it became a catch-all for any block device (another Unix term; in this context, anything capable of carrying data) that wasn't already accessible via IDE. When SATA came around, the developers figured it'd be much easier and much more convenient for everyone to add it into the existing framework rather than write a whole new framework.

  • The letter immediately after sd signifies the order in which it was first found -- a,b,c...z, Aa...Az... etc. (Not that there are many situations in the real world where more than 26 discrete block devices are on the same bus...)

  • Finally, the number after that signifies the partition on the device. Note that because of the rather haphazard way PCs handle partitioning, there are only four "primary" partitions, so the numbering will be slightly off from the actual count. This isn't a terrible problem as the main purpose for the naming scheme is to have a unique and recognizable identifier for each partition found in this manner...

To answer your specific question: /dev/sda9 means the ninth partition on the first drive.

8
  • 1
    /dev/sd[A-Z][a-z] actually is considered invalid by AWS now, unless it requires extra configuration.
    – cxdf
    Jan 11, 2016 at 21:04
  • 1
    A metaphor is usually related in some sort of tangential way that is more closely related to the addressee's experience than the concept or thing one wishes to explain. So one might explain the workings of a processor in terms of tractors and muddy boots to a farmer, for example. The hope is the addressee will be able to utilise the symbolic link(s) in order to mentally construct a working model of whatever the addresser is describing, without first-hand knowledge. So it's only really a lie in the same way a block-chain is a lie about a pass-phrase. In fact, a blockchain is a sort of metaphor. May 16, 2016 at 15:59
  • 1
    Note that with NVMe instead of SATA, the name of the first device is /dev/nvme0n1
    – Boiethios
    Jul 28, 2017 at 20:26
  • 1
    @Shadur what if on df -h I see sda and sde but not sdb?
    – mrgloom
    Jul 26, 2019 at 13:45
  • 1
    @mrgloom drive 'letters' are not automatically resequenced every time they change -- if I had to guess, I'd say you've plugged and unplugged several USB data carriers since the last time this system was rebooted. Jul 26, 2019 at 14:05
25

/dev is your filesystem representation of devices your system understands - providing a mechanism for applications to access data on the device without needing to know specifically what the device is.

sd is for (originally) scsi disk devices, however it seems to now refer to removable devices in general and SATA devices

and the letter is just the number of the device, starting at a, with the number indicating the partition.

0
21

sd originates from the driver sd-mod. It literally stands for scsi disk.

The reason (S)ATA disks are also listed as SCSI disks is, SCSI commands pretty much provides a superset of features that can be provided by ATA commands, therefore modern systems (including Windows, AFAIK) will have an implementation of SCSI-ATA Translation Layer (SATL) in the system (in Linux it is provided by the libata driver) to talk to the (S)ATA disks, while the upper layer of the system can be generalized.

As you may not aware of, USB drives "speaks" SCSI (i.e. takes and responds to SCSI commands), no matter if it supports the USB Attached SCSI Protocol or not. Also, most of the USB HDDs/SSDs are SATA disks bridged to USB. For those the bridge provides the SATL, but not the operating system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .