Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] Who/what names hard drives /dev/sda, /dev/sdb, etc

19 views
Skip to first unread message

Chris Stankevitz

unread,
Jun 7, 2013, 12:20:01 AM6/7/13
to
Hello,

Who or what decides to name a hard drive /dev/sda vs /dev/sdb?

How does it decide what order to enumerate the drives on my computer?

When in the boot process does is a disk given a name like "/dev/sda"?

Thank you,

Chris

Fast Turtle

unread,
Jun 7, 2013, 1:40:01 AM6/7/13
to
The /dev/ (h/s)da is actually from the kernel itself with the (H) being deprecated as it's from the old ide/pata setup (hda was always ide 0-0 (same setup grub uses) designated as master) while 0-1 was the slave. 1-0 would then be hdb while 0-1 would have been hdc with hdd being 1-1 (the last two being slaves).

The (S) designation is due to the change in the kernel hardware subsystem, where they started moving all of the various drive types to a single, simpler uniform setup based around the scsi code. It's also why when manually configuring a kernel, if you enable usb storage (flash/sd/mmc) you're told you need scsi support in the help.

All of these changes have been implemented by the kernel team comprised of Linus Torvald and all of the maintainers for the express purpose of simplifying the code base while reusing as much of the existing code as possible in a far more modular manner - easier to fix/maintain and by becoming more modular, it's easier to add new features to the kernel as they're developed, which is why if you look at the configuration of a 3.4 series compared to the 3.8 you see lots of things have and are being moved.

Thomas Mueller

unread,
Jun 7, 2013, 2:00:02 AM6/7/13
to
> Who or what decides to name a hard drive /dev/sda vs /dev/sdb?

> How does it decide what order to enumerate the drives on my computer?

> When in the boot process does is a disk given a name like "/dev/sda"?

> Thank you,

> Chris

I believe it depends on how the drives are connected.

/dev/sda would be the default boot drive, though modern computers can be configured to boot from any drive recognized by the BIOS or UEFI.

Older versions of the Linux kernel named IDE/ATA hard drives, and CD/DVD drives too, as /dev/hda, /dev/hdb and so on.

Tom

Philip Webb

unread,
Jun 7, 2013, 5:50:02 AM6/7/13
to
130606 Chris Stankevitz wrote:
> Who or what decides to name a hard drive /dev/sda vs /dev/sdb?

You, when you connect up the drives in the box, if you build it ;
the manufacturer, if you buy the machine ready-built.
If the latter, open the box -- carefully (smile) --
& check the connections inside with the mobo manual.

> How does it decide what order to enumerate the drives on my computer?

The drive which the mobo calls 'SATA1' wb /dev/sda etc.

> When in the boot process does is a disk given a name like "/dev/sda"?

That's done by 'udev' based on what BIOS tells it.

--
========================,,============================================
SUPPORT ___________//___, Philip Webb
ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto
TRANSIT `-O----------O---' purslowatchassdotutorontodotca

Chris Stankevitz

unread,
Jun 7, 2013, 12:40:02 PM6/7/13
to
On Fri, Jun 7, 2013 at 2:43 AM, Philip Webb <pur...@ca.inter.net> wrote:
>> When in the boot process does is a disk given a name like "/dev/sda"?
>
> That's done by 'udev' based on what BIOS tells it.

Hi Philip,

Is this a true statement:

Some people do not use udev. These people still have a /dev/sda.
Therefore something other than udev is giving drives the name
"/dev/sda".

Thank you,

Chris

staticsafe

unread,
Jun 7, 2013, 12:50:02 PM6/7/13
to
Yes, the kernel does this.
--
staticsafe
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Please don't top post - http://goo.gl/YrmAb
Don't CC me! I'm subscribed to whatever list I just posted on.
0 new messages