Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General > Member Success Stories
User Name
Password Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.


  Search this Thread
Old 10-09-2006, 06:54 AM   #1
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358

Rep: Reputation: 35
Dual boot Linux recovery after Windows goes bad.

Ever had the problem of not being able to boot Linux after fixing Windows?

This usually happens when you have to do a Windows re-install, but I have also had it after doing a hard reset when Windows crashes, and scandisk runs and "fixes" the boot sector. I've had to do this several times, but not for a while, so had to search LQ to find a fix the other day when my Mum's computer played up. I have migrated her to Linux, but needed to get at something on the old Win98 system, and of course it crashed while I was doing it. I thought it might be good to have an up-to-date fix here.

You will need either a Linux boot floppy (there are some good ones at Slackware) or a bootable CD (a live CD). I use either GParted, which can also help with partitioning and disk maintenance, or RIP (Recovery Is Possible). You can also use CD 1 of the Suse install set (select Rescue from the boot menu). Most distro's with a live CD have a rescue option on the boot menu. I gather Ubuntu doesn't have it on the menu, but you can get it by typing "rescue" at the point where you enter boot parameters.

With one of the Slack boot floppies you can actually boot your existing Linux system. If you can do this go to Part 2 below.

If you can't boot your existing sytsem then you will need to use a live disk.

Part 1 - if you have booted a live CD.

Open a console window as root, and mount your Linux root partition to a temporary directory.
#> mkdir /tmp/hdxx
#> mount /dev/hdxx /tmp/hdxx
/dev/hdxx is whichever partition is root for your Linux. For instance on this system it's /dev/hda3. If you can write to /mnt then you could use /mnt/hdxx.

For GRUB you will also need to do this:
#> mount --bind /dev /tmp/hdxx/dev 
#> mount --bind /proc /tmp/hdxx/proc 
#> chroot /tmp/hdxx /bin/bash
Part 2 - re-installing the bootloader

#> grub-install /dev/hda 
#> exit
...and reboot. Don't forget to take out the boot disk first!

#> /sbin/lilo
You should see a list of bootable partitions.

 #> exit
... and reboot.

You should now have your boot menu back.

I also found some useful info about backing up the MBR here.

There is also a GRUB wiki, and How to Set-up Grub by hand

Hope you find this useful, and thanks to all those who posted different versions of this around the web.

Last edited by sadiqdm; 02-10-2007 at 12:56 PM. Reason: Updated Live CD bit & added links to GRUB wiki


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
Partition Table Recovery in Linux/XP Dual Boot PC kumarnine Linux - Software 3 04-19-2006 10:50 PM
How to dual boot Suse linux and XP with only recovery disks and one hard drive Jonnyk429 Linux - Newbie 1 02-09-2006 02:51 PM
How do I dual boot Linux and Windows XP from Windows boot file andyri Linux - Newbie 4 08-04-2004 10:09 PM
Stupid Automatic Recovery After Dual Boot of XP Home and RH/Linux 9 on Pavilion 784 michel.subs Linux - Newbie 1 09-25-2003 02:58 PM
Linux Boot Floppy Went Bad on W2K-Linux Dual Boot rzward Linux - General 2 01-15-2003 10:52 AM > Forums > Linux Forums > Linux - General > Member Success Stories

All times are GMT -5. The time now is 02:07 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