August 30, 2014
 
 
RSSRSS feed

Corraling Linux Hard Disk Names

Name That Hard Disk!

  • April 3, 2008
  • By Carla Schroder
The Linux kernel is a restless beast, and must continally evolve and change. Especially in ways that mystify us poor end lusers. A recent wrinkle, as of kernel version 2.6.20, is changing the /dev names for ATA devices, so that all ATA and SCSI devices are named /dev/sd*. This is a result of using the shiny new libata subsystem. In the olden days PATA (also called IDE) hard drives and ATAPI devices (CD/DVD, tape drives) were /dev/hd*, and SCSI and SATA devices were /dev/sd*.

However, not all Linux distributions default to using libata. *buntu Feisty and Gutsy are all over the map; some versions of them use the new naming convention, some don't, and I haven't figured out which ones, or why. You can see how your own system handles these names with a couple of simple commands. This example from Kubuntu Gutsy shows the old style:

$ ls /dev|grep '[s|h]d[a-z]'
hda
hda1
hda2
hdc
hdd
sda
sda1
sda2

$ mount|grep ^'/dev'
/dev/hda1 on / type ext3 (rw,errors=remount-ro)
/dev/sda1 on /home type ext3 (rw)
/dev/sda2 on /media/sda2 type ext3 (rw)
/dev/hda2 on /var type ext3 (rw)

The first command shows all the ATA and SCSI devices detected by your kernel. The second command shows which ones are mounted. On this system there is one PATA hard disk with two partitions (hda), two CD/DVD drives (hdc, hdd), and one SATA disk with two partitions (sda). When I boot into Fedora 8, which defaults to libata, it looks like this:
$ ls /dev|grep '[s|h]d[a-z]'
sda
sda1
sda2
sdb
sdb1
sdb2
Where are the two CD/DVD drives? These get /dev/sr* names under libata:
$ ls /dev|grep sr
sr0
sr1
Sitemap | Contact Us