What is hd0 and sda/sdb in Linux?
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping
--
Chapters
00:00 What Is Hd0 And Sda/Sdb In Linux?
01:09 Accepted Answer Score 19
01:46 Answer 2 Score 5
01:58 Answer 3 Score 1
02:19 Answer 4 Score 1
02:52 Answer 5 Score 0
03:04 Thank you
--
Full question
https://superuser.com/questions/158255/w...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #grub #mbr
#avk47
ACCEPTED ANSWER
Score 19
When GRUB probes devices it makes a device.map file, you can find this in the same directory as your grub.conf. It will look similar to this:
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
You are free to modify this as you see fit any time. Read more here.
UPDATE (Oct. 21, 2015) : This answer was originally written for GRUB 0.9x which is not under active development and is now referred to as GRUB Legacy. If you are using a version of GRUB 2.x you want this page with details and advice on device mapping.
ANSWER 2
Score 5
I believe that
sda = hd0,
sdb = hd1,
so on etc. etc. sdc = hd2
When it says sda1
that would be (hd0, 0)
and sda2 (hd0, 1)
and sda3 (hd0, 2)
and sdb1 (hd1, 0)
so on and so forth...
ANSWER 3
Score 1
grub does not make any difference between scsi and ide devices in its naming convention. the difference is only at the operating system level. Infact if you go to the grub command-line mode, you will be able to try the devices available by tabbing. refer this article for a nice grub tutorial
ANSWER 4
Score 1
sudo grub-mkdevicemap
sudo cat /boot/grub/device.map
will show you something like this:
(hd0) /dev/disk/by-id/ata-Samsung_SSD_850_EVO_500GB_S21JNXAG900082K
(hd1) /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21UNXAH101068L
(hd2) /dev/disk/by-id/ata-WDC_WD10EZEX-08M2NA0_WD-WCC3F3579300
ls /dev/disk/by-id -lt
will show something like this (and more):
ata-Samsung_SSD_850_EVO_500GB_S21JNXAG900082K -> ../../sda
ata-Samsung_SSD_850_EVO_120GB_S21UNXAH101068L -> ../../sdb
ata-WDC_WD10EZEX-08M2NA0_WD-WCC3F3579300 -> ../../sdc
Now you know for sure: hd0 = sda, hd1 = sdb, hd2 = sdc.
ANSWER 5
Score 0
Grub device names can be confusing, but you can use the linux device name and let grub figure it out. Like this:
burg-install /dev/sda