Link to home
Start Free TrialLog in
Avatar of atorex
atorex

asked on

Grub disk mapping

Can someone help me resolve an issue I'm having when restoring a disk image to a new Hard drive,
the issue is that grub is creating the device mapping for the hard drive as per below line and this points to a model and serial.
(hd0)      /dev/disk/by-id/ata-WDC_WD400BB-23JHC0_WD-WMAMA5669406

Is there a way I could make it a generic mapping like /dev/sda rather then hard drive pacific so when I restore the image grub will load the OS.
Avatar of rindi
rindi
Flag of Switzerland image

You could change it to /dev/sda1 for the first disk and first partition, or /dev/sda2 if it is the 2nd partition on the same disk, or /dev/sda5 if it is the first logical partition of the same disk.
Avatar of atorex
atorex

ASKER

Rindi,
in addition to device.map I will need to change the menu.lst, is there any other file I need to make the change and is what I'm asking  a correct way of resolving my issue?
ASKER CERTIFIED SOLUTION
Avatar of rindi
rindi
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of atorex

ASKER

Now that's a better option, what is the best way to obtain the UUID for a drive?
I currently have a cloned drive attached to my server so I can make the edit is there a command that will provide the UUID?
I don't remember the command (but yes, there is one). Most of the Linux Distro's I use have gparted or another graphical partitioning tool included. When I check the partition's properties using that tool it's ID is listed, and I then mark it and copy it into the clipboard, so I can paste into into the Grub file.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of atorex

ASKER

by making the change to grub this is how I see it please validate

(hd0)      /dev/disk/by-id/908b1bf7-8d45-4b62-852c-69daffd6cb7a

when I run the blkid of my /dev/sda2 i get 908b1bf7-8d45-4b62-852c-69daffd6cb7a so I just need to insert it as above or as below

(hd0)      /dev/908b1bf7-8d45-4b62-852c-69daffd6cb7a
It would have to be like this:

 Linux      /boot/Kernel-3.0.6.xxxxx   root=UUID=908b1bf7-8d45-4b62-852c-69daffd6cb7a

Where Linux can also be kernel, and you'd have to replace the /boot/kernelxxxxxx with what you have. It can sometimes be differently used, depending on the Distro (my example is from Ubuntu).
One thing I just remembered you would also have to check is the /etc/fstab file.
Avatar of atorex

ASKER

I'm using SUSE 11, what I have on the menu.lst is


root (hd0,1)
    kernel /boot/vmlinuz-2.6.32.12-0.7-default root=908b1bf7-8d45-4b62-852c-69daffd6cb7a resume=/908b1bf7-8d45-4b62-852c-69daffd6cb7a splash=silent  showopts vga=0x317


what about the device.map should that be changed at all?
Device.map should be OK.

Use this:

root (hd0,1)
    kernel /boot/vmlinuz-2.6.32.12-0.7-default root=UUID=908b1bf7-8d45-4b62-852c-69daffd6cb7a resume=/908b1bf7-8d45-4b62-852c-69daffd6cb7a splash=silent  showopts vga=0x317

Avatar of atorex

ASKER

root (hd0,1)
    kernel /boot/vmlinuz-2.6.32.12-0.7-default root=UUID=908b1bf7-8d45-4b62-852c-69daffd6cb7a resume=UUID=908b1bf7-8d45-4b62-852c-69daffd6cb7a splash=silent  showopts vga=0x317


the above gets me beyond the error I was getting no I get Only CONTROL-D will reboot
Avatar of atorex

ASKER

fstab is using the below
/dev/disk/by-id/ata-WDC_WD400BB-23JHC0_WD-WMAMA5669406-part2 /

should it be
 root=UUID=908b1bf7-8d45-4b62-852c-69daffd6cb7a /
Leave the root= out of fstab, just use UUID=908b1bf7-8d45-4b62-852c-69daffd6cb7a /
Avatar of atorex

ASKER

Man, you are the best, I noticed that root= should be out and I am in, thanks a bunch man this is awesome.