EXPLAIN: Why is There no HDA0 or SDA0?
Reader Geoff is breaking by b**ls these days by bringing up questions that I have no idea how to answer. In this case, he brought up a good question about drive naming convention. More specifically, why do hard drives start their naming at 1 (as in HDA1)? Why is there no HDA0?
A quick overview of drive naming conventions is here, but that entry doesn’t cover off the ‘zero’ question.
I found the answer in the Linux Device List. This is an excellent list/explanation that, while really long, is a very complete listing of the naming conventions that the Linux kernel will use to name different types of devices. Some of the gems in this list are:
-
Majors:
- Unnamed ……. (unknown) …. for proc-fs, NFS clients, etc. (???)
- Memory …….. (character) .. mem ramdisk kmem null port zero core
- Floppy …….. (block) …… fd[0-3]< [dhDH]{360,720,1200,1440}>
- AT-Disk ……. (block) …… hd[a-b]< [0-8]>
- Tty ……….. (character) .. tty’s and pty’s
- Dial-out …… (character) .. tty cua*
- Parallel …… (character) .. par[0-2] lp[0-2]
- SCSI-Disk ….. (block) …… sd[a-h]< [0-8]>
- SCSI-Tape ….. (character) ..
st[0-1] or rmt[0-1] - Mouse ……… (character) .. logibm psaux inportbm atibm (mouse)
- CD-ROM …….. (block) …… scd[0-1]
- QIC-tape? ….. (character) .. rmt{8,16} tape< {-d,-reset}>
- XT-disk ……. (block) …… xd[a-b]< [0-8]>
- Audio ……… (character) .. audio dsp midi mixer sequencer
- Joystick …… (character) .. js[0-1]
- Socket …….. (character) .. net arp
- AF_UNIX ……. (character) .. unix
- AF_INET ……. (character) .. inet ip icmp tcp udp
- WE-driver ….. (character) .. we[0-3]
- DP8390-driver . (character) .. wd[0-3] ec[0-3] ne[0-3]
- Sony-CD-ROM … (block) …… sonycd
- 2nd AT-Cntrlr . (block) …… hd1[a-b]< [0-8]>
- Mitsumi CD-ROM (block) …… mcd
- Link Interface (character?) . ???
But the short answer to the question is that both names like HDA and HDA0 refer to the entire device.
BE *VERY* CAREFUL WITH the four “whole drive” devices (hda, hdb, hdc, and hdd)!! These four devices embody the *entire* *drive*, not just one partition. The only things that use them are things that need to read/change the partition table(like fdisk).
Related Stories
POSTED IN: Explanation
7 opinions for EXPLAIN: Why is There no HDA0 or SDA0?
Geoff
Oct 12, 2005 at 9:41 pm
Very helpful, Jon. Thanks!
Jon
Oct 13, 2005 at 5:56 am
You’re welcome.
I guess I didn’t really expand on why there is an fd0. I suppose (pure speculation here) that because there’s no real notion of partitioning a floppy drive that it’s proper to refer to the whole drive.
Geoff
Oct 13, 2005 at 10:14 pm
I now remember where I saw hd0.
It was during the Debian install, when it got to setting up GRUB.
I’ll be reinstalling tomorrow night, so I’ll try to make note of exactly what it says (and in what context).
Jon
Oct 14, 2005 at 6:10 am
Ahh..well, like the man says about the ‘0′ partitions:
It makes sense to see in during mucking around with GRUB.
Geoff
Oct 14, 2005 at 9:08 am
But hd0 (without a trailing letter, as with hda, hdb, etc.)…could that be referring to the MBR?
Jon
Oct 14, 2005 at 11:25 am
Oh, I think we’re getting off track. There is no hd0, there’s always a letter. It’s those first two letters that mean it’s an AT hard drive (as per item 5 in the list above.
I didn’t catch that when you mentioned it. I *think* you probably saw hda0 or hdb0 or something. If you saw plain old hd0 (with no letter) then I’m misunderstanding how this whole thing works :)
The MBR (Master Boot Record) as I understand it, must reside on the first (as in first to be booted) disk on a system. It’s the area that the computer actually boots into once the POST is complete.
Consider this:
1 hard disk divided into two parititons and GRUB install in the MBR.
This situation actually gives you three partitions. The MBR which contains GRUB, and then hda1 and hda2 both of which contain operating systems.
The computer boots into the MBR and the ‘OS’ resident on the MBR displays GRUB to you. You then select which partition (usually displayed as the installed Operating System names) from the GRUB menu that you want to boot into. The system then ‘boots’ into that partition. The installed OS on your selected partition has no knowledge that anything occured before it was booted.
Does that make sense?
Geoff
Oct 14, 2005 at 10:16 pm
It does make sense. However, during the Debian install from netinst CD, it definitely says:
…right before it asks to remove the CD and reboot.
The rest of the stuff flashes by too quickly to read.
Have an opinion? Leave a comment: