LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-28-2013, 09:45 AM   #1
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Rep: Reputation: 15
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
 
Old 06-28-2013, 12:25 PM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
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.
 
Old 06-28-2013, 03:30 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
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.
 
Old 06-28-2013, 06:43 PM   #4
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Original Poster
Rep: Reputation: 15
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?
 
Old 06-28-2013, 07:14 PM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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.
 
Old 06-28-2013, 07:28 PM   #6
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Original Poster
Rep: Reputation: 15
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.
 
Old 06-28-2013, 07:33 PM   #7
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Original Poster
Rep: Reputation: 15
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?
 
Old 06-28-2013, 07:40 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
Old 06-28-2013, 07:57 PM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by sysbox View Post
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
 
Old 06-28-2013, 08:10 PM   #10
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
It's like pingu said:

Quote:
Originally Posted by pingu View Post
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.
 
Old 06-28-2013, 08:23 PM   #11
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Original Poster
Rep: Reputation: 15
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.
 
Old 06-29-2013, 12:31 AM   #12
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
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'

Last edited by Madhu Desai; 06-29-2013 at 12:44 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to copy my hard drive to a larger hard drive and boot from the new drive. lpmorgan1 Ubuntu 8 09-07-2009 11:26 PM
Formated hard drive, runing ubuntu cd cant install, get fedora 11 to boot from hard d IanHarper Linux - Desktop 9 08-10-2009 10:09 PM
Adding Hard Drive To Grub Menu dynamata Linux - Newbie 3 07-18-2009 10:18 PM
GRUB / menu.lst problems with new linux distro on second hard drive kevinbenko Linux - Kernel 7 08-04-2008 11:19 PM
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-04-2007 11:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration