Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-09-2006, 05:17 PM   #1
Registered: Jul 2004
Location: Canada
Distribution: none right now
Posts: 31

Rep: Reputation: 15
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!
Old 04-09-2006, 05:55 PM   #2
Registered: Sep 2005
Location: UK
Distribution: Ubuntu 12.04 LTS
Posts: 76

Rep: Reputation: 16
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.


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??
Old 04-09-2006, 05:56 PM   #3
Senior Member
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098

Rep: Reputation: 54
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.

Last edited by detpenguin; 04-09-2006 at 06:00 PM.
Old 04-09-2006, 06:07 PM   #4
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.
Old 04-09-2006, 06:35 PM   #5
Registered: Jul 2004
Location: Canada
Distribution: none right now
Posts: 31

Original Poster
Rep: Reputation: 15
I popped in my XP CD, got into the recovery console and typed fixmbr . All done!

How I love you all ;-)


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
GRUB removal(I can't) JacKenshin SUSE / openSUSE 3 01-29-2005 05:15 PM
Grub Boot loader removal?? 1fastminivan Linux - Software 2 12-15-2004 01:29 PM
"GRUB error 15" after hard drive removal maxfacta Linux - General 2 08-31-2004 08:59 AM
grub removal Diablo25 Member Success Stories 1 05-30-2003 10:31 PM
Grub removal buddycwll Linux - General 5 09-05-2001 03:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:21 AM.

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