LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub Error 5 after drive removal (https://www.linuxquestions.org/questions/linux-newbie-8/grub-error-5-after-drive-removal-433459/)

stranger777 04-09-2006 05:17 PM

Grub Error 5 after drive removal
 
I had this:

HD 1 (80GB) with Windows XP
HD 2 (40 GB) with Ubuntu one one partition and more XP stuff on the other


I removed HD 2 and installed a new drive with 300 GB.

The BIOS recognizes the new slave, but Grub gives me an "error 5" and I can't boot into XP.

Any help appriciated!

wanderingmind 04-09-2006 05:55 PM

Grub manual says that error 5 means:

-------------
5 : Partition table invalid or corrupt
This error is returned if the sanity checks on the integrity of the partition table fail. This is a bad sign.
-------------

hm..?

so GRUB was installed on HD1, which is the booting HD
But your Linux was on HD2, and you removed it..

And you expected that you can still boot to XP, even though not to Linux.. It could be (not sure?) that GRUB somehow expects the Linux partition to be present..

Well, for sure one way out of this will be to boot from a Linux CD and install linux on the new 300Gb drive (or a to end of XP on HD1), and let it write a new bootloader on HD1. Then it will work ok for both XP and your new linux.

Hypothesis 2 would be that your new drive is somehow broken??

detpenguin 04-09-2006 05:56 PM

while grub was probably loaded into the mbr on hda...the actual grub config file was in ubuntu...when you removed ubuntu, you removed the boot folder with the config.file. you can either try rewriting the mbr in xp recovery console, or load ubuntu onto the new disk, and reinstall grub.

saikee 04-09-2006 06:07 PM

detpenguin has hit the nail on its head.

Grub works by having its stage1 in the MBR. The stage1 then called stage1.5 stored in Ubuntu's partition's boot sector. The stage1.5 then boots stage2 which is the actual intelligence of Grub. Stage2 is too big and must be stored in every Linux's /boot/grub directory. The location of stage2 would have been hard-coded and so Error 5 would be issued if stage2 isn't found. Grub can't survive without stage2.

The problem may be overcome by making a bootable Grub floppy, which contains stage1 and stage2, so that XP can be booted manually. Alternatively the Windows MBR should be restored. The last link of my signature has all these relevant booting tips.

stranger777 04-09-2006 06:35 PM

Thanks!
I popped in my XP CD, got into the recovery console and typed fixmbr . All done!

How I love you all ;-)


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