Linux – What does /dev/sda in Linux mean

fedoralinuxUbuntu

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.

Best Answer

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.

Related Question