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_WD 400BB-23JH C0_WD-WMAM A5669406
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.
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_WD
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.
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.
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
by making the change to grub this is how I see it please validate
(hd0) /dev/disk/by-id/908b1bf7-8 d45-4b62-8 52c-69daff d6cb7a
when I run the blkid of my /dev/sda2 i get 908b1bf7-8d45-4b62-852c-69 daffd6cb7a so I just need to insert it as above or as below
(hd0) /dev/908b1bf7-8d45-4b62-85 2c-69daffd 6cb7a
(hd0) /dev/disk/by-id/908b1bf7-8
when I run the blkid of my /dev/sda2 i get 908b1bf7-8d45-4b62-852c-69
(hd0) /dev/908b1bf7-8d45-4b62-85
It would have to be like this:
Linux /boot/Kernel-3.0.6.xxxxx root=UUID=908b1bf7-8d45-4b 62-852c-69 daffd6cb7a
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).
Linux /boot/Kernel-3.0.6.xxxxx root=UUID=908b1bf7-8d45-4b
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.
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-85 2c-69daffd 6cb7a resume=/908b1bf7-8d45-4b62 -852c-69da ffd6cb7a splash=silent showopts vga=0x317
what about the device.map should that be changed at all?
root (hd0,1)
kernel /boot/vmlinuz-2.6.32.12-0.
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-4b 62-852c-69 daffd6cb7a resume=/908b1bf7-8d45-4b62 -852c-69da ffd6cb7a splash=silent showopts vga=0x317
Use this:
root (hd0,1)
kernel /boot/vmlinuz-2.6.32.12-0.
ASKER
root (hd0,1)
kernel /boot/vmlinuz-2.6.32.12-0. 7-default root=UUID=908b1bf7-8d45-4b 62-852c-69 daffd6cb7a resume=UUID=908b1bf7-8d45- 4b62-852c- 69daffd6cb 7a splash=silent showopts vga=0x317
the above gets me beyond the error I was getting no I get Only CONTROL-D will reboot
kernel /boot/vmlinuz-2.6.32.12-0.
the above gets me beyond the error I was getting no I get Only CONTROL-D will reboot
ASKER
fstab is using the below
/dev/disk/by-id/ata-WDC_WD 400BB-23JH C0_WD-WMAM A5669406-p art2 /
should it be
root=UUID=908b1bf7-8d45-4b 62-852c-69 daffd6cb7a /
/dev/disk/by-id/ata-WDC_WD
should it be
root=UUID=908b1bf7-8d45-4b
Leave the root= out of fstab, just use UUID=908b1bf7-8d45-4b62-85 2c-69daffd 6cb7a /
ASKER
Man, you are the best, I noticed that root= should be out and I am in, thanks a bunch man this is awesome.