LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Boot Menu: Which Hard Drive is What ID? (https://www.linuxquestions.org/questions/linux-newbie-8/boot-menu-which-hard-drive-is-what-id-4175467716/)

sysbox 06-28-2013 09:45 AM

Boot Menu: Which Hard Drive is What ID?
 
I have a PC with several hard drives running CentoS 6.4. I ran into problems with the Boot Record, I think. When I reboot and then escape-into the BIOS to select the hard drive from which to boot, it lists the hard drives, but only by long cryptic IDs like: PM-ST36fe5348a53........

How can I figure out which hard drive is each ID?

Thanks

pingu 06-28-2013 12:25 PM

Ugh, this is tricky!
You need to know what kind of disks you have and compare to BIOS list.
For example, I'd guess that the disk "PM-ST36fe5348a53" is a Seagate ("ST"), if it's labeled "WD" it's a WesternDigital etc. If you have several disks of same brand you'll have to know the id (there should be a label on the disks).
Sometimes, you can get hardware informatin in BIOS which could output things like the size of the disks making it a lot easier.

jefro 06-28-2013 03:30 PM

Usually bios would report a port number and the OEM disk number that is burned on the disks chip memory.
See this for ideas. http://www.sevenforums.com/installat...k-numbers.html

Modern bios's don't really care too much anymore. You set the boot order in the hard drive order and that affects how loaders view them if you use the convention like sda or sdb. In some cases you may wish to use by device id or uuid.

If you happened to know what disk data is on what port that may help, some distro's are moving to more Freebsd style information to help decide what is what.

sysbox 06-28-2013 06:43 PM

My problems arised because I purchased an SSD drive, and when I connected that to another SATA port and tried to boot, the hard drives now were re-ordered, or received new numbers. My grub.conf no longer worked. I had to boot from a rescue disk, edit grub.conf, and change the hd numbers. Why does that happen? Can I prevent this?

Firerat 06-28-2013 07:14 PM

You can prevent it by using UUID in grub.cfg

it only gets a breif mention here
Quote:

Originally Posted by http://wiki.centos.org/HowTos/GrubInstallation
root=/dev/sda6

Location of root partition, using conventional naming system. The root partition can also be identified using the file system's UUID (universally unique identifier) as follows: root=UUID=134d2a24-2699-4b0c-823b-1e13633f3b07. CentOS now uses UUIDs by default. You can find a file system's UUID with the following command: tune2fs -l /dev/sda6.

claims it uses UUID by default, you could try upgrading grub packages or maybe un-install ( including configuration) and reinstalling

In your grub you should end up with something like
Code:

..blahblah..
set root='hd3,gpt2'
..blah..
linux /boot/vmlinuz-3.9-1-amd64 root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
..blah..

Root device is still 'hard coded', but is later overruled by UUID.
at least that is what Debian's /etc/grub.d scripts seem to do.

As for the why..
my best guess is that your New drive got plugged into a SATA port with a lower number than the rest.
Easily done, the layout of some boards SATA ports just don't seem to match with what you'd expect.

sysbox 06-28-2013 07:28 PM

I don't think the UUIDs in grub.conf forked for me. My machine is already CentOS and already uses UUIDs in grub.conf. But, it seems like they are not overridden. After I installed the SSD I still had to edit the grub.conf file and change entries like root (hd1,0) to root (hd0,0).

However, the 'tune2fs -l /dev/sda6' command is nice. It tells me what the UUID is for each partition.

sysbox 06-28-2013 07:33 PM

Also, the UUID numbers aren't what the BIOS uses to describe the hard drive. In the BIOS, it's something like PM-ST36fe5348a53 or whatever (I don't have the exact identifier handy). How can I determine that identifier?

Firerat 06-28-2013 07:40 PM

actually,. yes
Now I think about it .. it won't work, it is not an override

the first is where the kernel is ( /boot ), and then the kernel is passed the rootfs's UUID

I'd have to test to see if UUID can be used for the initial set root and tweak the grub.d scripts

Firerat 06-28-2013 07:57 PM

Quote:

Originally Posted by sysbox (Post 4980525)
Also, the UUID numbers aren't what the BIOS uses to describe the hard drive. In the BIOS, it's something like PM-ST36fe5348a53 or whatever (I don't have the exact identifier handy). How can I determine that identifier?

Code:

sudo -i
for i in {a..f};do hdparm -i /dev/sd$i;done
exit

as mentioned previously that looks like a seagate model number *format*
http://knowledge.seagate.com/article...S/FAQ/204763en

I'm guessing the PM is added by the Bios, Primary Master? , but just a guess

if another is PS-, that would be Primary Slave.

Your bios might be set for PATA mode instead of ACHI
https://en.wikipedia.org/wiki/Advanc...ller_Interface

Z038 06-28-2013 08:10 PM

It's like pingu said:

Quote:

Originally Posted by pingu (Post 4980337)
Ugh, this is tricky!
You need to know what kind of disks you have and compare to BIOS list.

Some commands that might help you correlate everything:

Code:

fdisk -l 
cat /proc/partitions
lsblk
smartctl -i /dev/xxx        (where xxx is the device name, like sda)
hdparm -I /dev/xxx
blkid

The fdisk command will list device total size, partition name (device name, like /dev/sdX), and partition size. blkid lists the device name and UUID. smartctl and hdparm lists the disk size, and the model name and serial. The bios will often list the either model name or serial too. blkid lists the UUIDs. lsblk shows partition names, sizes, type, and mount points.

Generally by cross-referencing the output of all these commands, you can figure out which disk is which.

sysbox 06-28-2013 08:23 PM

Actually, it's 'hdparm -I /dev/sdXX | grep -i 'model number' which will list the same ID that the BIOS uses (at least on my PC) when selecting drives for the boot order. But thanks very much the help.

Madhu Desai 06-29-2013 12:31 AM

Use lsscsi
Code:

$ lsscsi
[0:0:0:0]    disk    ATA      Maxtor 6Y250P0  YAR4  /dev/sda
[0:0:1:0]    disk    ATA      ST340016A        3.19  /dev/sdb
[2:0:0:0]    disk    ATA      ST31000524AS    JC45  /dev/sdc
[3:0:0:0]    cd/dvd  ASUS    DRW-2014L1T      1.00  /dev/sr0
[4:0:0:0]    disk    Sony    Storage Media    0100  /dev/sdd

In CentOS its not installed by default. you can install it by 'yum install lsscsi' or from CentOS DVD 'rpm -Uvh lsscsi-0.23-2.el6.x86_64.rpm'


All times are GMT -5. The time now is 02:50 AM.