View previous topic :: View next topic |
Author |
Message |
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
Posted: Tue Jun 13, 2006 1:35 am Post subject: [SOLVED] GRUB 0.97 in new MBR not working! |
|
|
I have an existing 120GB harddrive (/dev/hdh) that is failing. Here's a snippet of the partition table:
Code: | Disk /dev/hdh: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdh2 * 13319 13330 96390 83 Linux
/dev/hdh6 13513 14593 8683101 83 Linux
|
I installed a new 160GB harddrive (/dev/hdf). Here's a snippet of its partition table:
Code: | Disk /dev/hdf: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdf1 * 1 15 120456 83 Linux
/dev/hdf3 16 1216 9647032+ 83 Linux
|
/dev/hdh2 is a 100MB boot partition and /dev/hdh6 is my root partition. I migrated the contents of hdh to hdf successfully using tar. Using the working grub install in the MBR of /dev/hdh, I change the boot parameters and load linux from the new drive (hdf). Here's a snippet of what my mtab looks like now:
Code: | /dev/hdf3 on / type xfs (rw,noatime)
/dev/hdf1 on /boot type xfs (rw,noatime)
|
Now I need to boot off of the new harddrive using grub, so I install grub into hdf's MBR using the grub shell:<br><br>
Code: | grub> root (hd1,0)
Filesystem type is xfs, partition type 0x83
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/xfs_stage1_5" exists... yes
Running "embed /boot/grub/xfs_stage1_5 (hd1)"... 19 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+19 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
grub> quit
|
Assume (hd1) corresponds to /dev/hdf. As shown, it successfully completes. When I reboot the box, I change the BIOS to boot off of /dev/hdf and I get a quick glimps of "GRUB Loading stage1.5" then screen goes black. After about 10 seconds the computer reboots on its own. When I switch back the boot drive in the BIOS to the old harddrive (hdh), grub loads up no problem.
My grub.conf looks like this:
Code: | default 0
timeout 15
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo Linux 2.6.16.7 VGA HDH
root(hd2,1)
kernel (hd2,1)/boot/kernel-2.6.16-gentoo-r8 root=/dev/hdh6 ide=reverse
title=Gentoo Linux 2.6.16.7 VGA HDF
root(hd0,0)
kernel (hd0,0)/boot/kernel-2.6.16-gentoo-r8 root=/dev/hdf3 ide=reverse
#title=Windows XP
#map (hd0) (hd2)
#map (hd2) (hd0)
#rootnoverify (hd2,0)
#makeactive
#chainloader +1
|
... and my device.map (which I've had regenerated with grub-install many times) looks like this:
Code: | (hd0) /dev/hde
(hd1) /dev/hdf
(hd2) /dev/hdg
(hd3) /dev/hdh
|
Possibly related question: Is there a reason why when I'm in linux the grub shell gives me different results for harddrive mappings than when I'm booting the machine and I edit a grub statement? ... for example, (hd1) in linux corresponds to (hd2) when booting.
Last edited by cappaberra on Sun Jun 18, 2006 5:06 am; edited 3 times in total |
|
Back to top |
|
|
davidgurvich Veteran
Joined: 23 Apr 2004 Posts: 1063
|
Posted: Tue Jun 13, 2006 2:14 am Post subject: |
|
|
Use the grub command line to see what the problem is, bypass your grub.conf entirely. You can use tab completion to find out which partitions and kernels you need.
If you used tar to do the copying instead of dd, there may be permissions problems. Also, if you are changing the drive because you fear the old drive is failing, it may be too late. You may already have corruption of some files.
Booting from a CD may show what the environment looks like. |
|
Back to top |
|
|
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
Posted: Tue Jun 13, 2006 3:19 am Post subject: |
|
|
davidgurvich, some excellent ideas. Let me respond to them:
1) I'd love to use the grub command line... I don't think grub gets that far though. It doesn't seem to even attempt to load grub.conf to display the menu. In any event, do I just remove the grub.conf file to force grub to drop me in its shell?
2) I made sure to preserve permissions using tar... the command I used was the following (it works great!!!):
Code: | tar --one-file-system -cpf - . | (cd /some/new/path; tar -pxf -) |
I'm confident that the data on the "failing" harddrive is still intact--in other words, it isn't failing *yet*, i've just been noticing some errors in my syslog about that particular drive.
3) Yea, I have a gentoo install cd... Also have a few live cds. Note, I can still boot into linux using the old grub bootloader on the old harddrive's MBR, so I know what my environment is like. I'm going to try and use the Super Grub Disk (http://adrian15.raulete.net/grub/tiki-index.php) and see if I have any success with that.
Keep the questions/ideas coming, please!!! Thanks in advance!
-cappaberra |
|
Back to top |
|
|
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
Posted: Tue Jun 13, 2006 4:40 am Post subject: |
|
|
The SGD (super grub disk) is really neat. I'm able to boot to grub in the MBR of the new drive *going through* SGD. Still experiencing the same result when letting my BIOS try and boot. I'm working on a lead right now, so I'll post back when I have something. |
|
Back to top |
|
|
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
Posted: Tue Jun 13, 2006 5:21 am Post subject: new drive going between (hd0) and (hd2) |
|
|
So, I figured at least 1 thing out that I think is half of my battle:
in configuring the boot device in the BIOS of my RAID IDE controller (where the two "bootable" drives are located), I have a list of 4 devices... the one that is labeled "BOOT" is _always_ (hd0). When the "old" (/dev/hdh) harddrive is BOOT, the "new" (/dev/hdf) drive is _always_ (hd2); and visa versa. So that explains why things were different each time I booted from a different harddrive.
Now I'm trying to apply that wisdom to the rest of the grub install...... stay tuned. |
|
Back to top |
|
|
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
Posted: Sat Jun 17, 2006 6:27 am Post subject: grub Error 5 |
|
|
So, now I'm consistently getting bad results, which could be a great thing.
I'm getting a GRUB Error 5 now, which is supposedly a "bad" or "corrupted" partition table. I can see clear as day the partition table in linux and grub can tab complete it in the grub shell. I'm going to scour the internet and these forums for ideas on why it's doing it.
Any help is much appreciated!!!!! Thanks!
-cappaberra |
|
Back to top |
|
|
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
|
Back to top |
|
|
davidgurvich Veteran
Joined: 23 Apr 2004 Posts: 1063
|
Posted: Mon Jun 19, 2006 2:08 am Post subject: |
|
|
That is very interesting. I did not know that these stages could be omitted. |
|
Back to top |
|
|
cappaberra Tux's lil' helper
Joined: 24 Aug 2003 Posts: 77 Location: California, USA
|
Posted: Mon Jun 19, 2006 3:35 am Post subject: |
|
|
Indeed... it was a surprise to me too!
-cappaberra |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|