LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-20-2007, 07:31 PM   #1
dbough
LQ Newbie
 
Registered: Sep 2006
Distribution: Various - getting my feet wet!
Posts: 19

Rep: Reputation: 0
Fixing Windows MBR with Knoppix


I've recently installed CentOS 5 - in doing so I messed up my boot record (which isn't a surprise.)

I'm now using a Knoppix live DVD to try and fix the issue.

Setup:

sda = Windows HDD (SDA1, SDA2)
sdb = storage drive (only 1 partition)
hdb = linux PATA drive (hdb1 = /boot, hdb2 = /, hdb3 = swap)

I've tried booting into linux rescue mode with the CentOS DVD and fixing the mbr by typing "grub-install /dev/sda" and it seemed to pick up both hdb, and sda. But when I reboot I get "Grub Loading ..." or something to that sort, and then I get an "Error 15." I can't get any further than that.

Is there a way to fix the MBR on the Windows hard drive from the Knoppix DVD (been searching for a while and can't find a solution.)

Worst case scenario is I have to dig up my Windows CD and repair from that but I'd rather not.

Thanks!

DB
 
Old 04-21-2007, 06:17 AM   #2
dbough
LQ Newbie
 
Registered: Sep 2006
Distribution: Various - getting my feet wet!
Posts: 19

Original Poster
Rep: Reputation: 0
Update::

It seems I've really hosed my MBR. I've tried to boot with the Windows XP disc w/o success. It says "searching for components..." or something like that and then the screen just stays black.

I've booted with the Ultimate Boot CD and 'fixed' the MBR with various utilities (including System Mechanic.) All of which say they worked, but none of them actually do.

When I try to boot the PC the word 'Grub' sits in the lower left hand corner of the screen and the PC then hangs.

I thought the IDE drive may be giving issues and trying to boot first, so I removed the boot flag from that drive. I've also tried to reload CentOS on the IDE drive and choosing to not install a bootloader. Neither of these have worked.

I'm really at a loss here. My wife is going to ring my neck :P. My last option is to completely format the IDE drive and/or disconnect it and see what happens.

I'm hoping to avoid the two possible solutions if I can.

Thanks!!

DB
 
Old 04-21-2007, 07:43 AM   #3
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
According to here,

http://www.uruk.org/orig-grub/errors.html

Quote:
15 : "Error while parsing number"

This error is returned if GRUB was expecting to read a numbur and encountered bad data.
Not sure what that means.

I'm not real familiar with the Ultimate Boot Disk, but have you tried the Super Grub disk?

http://users.bigpond.net.au/hermanzo...isk_Quick_Help

I've saw SGD recommended many times.

IGF

Last edited by IndyGunFreak; 04-21-2007 at 05:51 PM.
 
Old 04-21-2007, 04:16 PM   #4
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
What I think is happening is when you run the command grub-install /dev/sda, grub uses the /boot/grub/grub.conf from the current root system. Since you are using a live cd it will of course use the one from the live cd and not the one from the hard drive.

What you need to do is to chroot into the root filesystem of the linux system, then install grub from there. that way it will point the mbr to the linux system to find the /boot/grub/grub.conf file.

The best way to do it would be to boot up with the knoppix dvd, it will automatically mount your drives, but best to dismount the drives and do it manually, since you have /boot and / filesystems on different partitions, we will place the whole OS under one directory for chrooting doesn't matter where but I just like to place it under the /mnt directory:

Code:
mount -t auto /dev/hdb2 /mnt
mount -t auto /dev/hdb1 /mnt/boot
chroot /mnt
grub-install /dev/sda
 
Old 04-22-2007, 05:12 AM   #5
dbough
LQ Newbie
 
Registered: Sep 2006
Distribution: Various - getting my feet wet!
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for the replies guys.

What I ended up doing was to use qtparted from the Knoppix DVD and blowing the partitions on the IDE drive away. After I did this I was able to boot with the Windows CD and fix the MBR on SATA1.

I think if my biow allowed me to change the hard drive boot order I could have avoided this headache, but of course it doesn't. I may move all of the data stored on SATA2 to the IDE drive and put linux on that one. I may take the IDE hard drive out all together and make a linux dedicated box - it's just hard to make room for a MAC, Windows, and Linux box on one undersized desk! :P

Thanks again!!

DB
 
Old 04-22-2007, 05:53 AM   #6
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Good to hear it's fixed either way.
 
  


Reply



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
can Knoppix fix the MBR for a Linux partition? joshknape Linux - Newbie 2 03-06-2006 11:38 PM
fixing my mbr bernstein Linux - General 7 06-30-2005 10:24 PM
I am in Knoppix. I have to delete the MBR or else... CAL Linux - Newbie 2 08-02-2004 11:25 AM
Fixing my fstab with Knoppix TheFishingGeek Linux - General 2 06-01-2003 10:41 PM
Fixing HD errors in Knoppix KungFuHamster Linux - General 7 05-01-2003 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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