nixCraft Poll

Topics

Fix a dual boot Windows Vista and Linux problem

Posted by Vivek Gite [Last updated: January 8, 2008]

How do you fix a dual boot system if you had to reinstall Windows Vista and you can no longer boot to Fedora Core 6 (FC6) or Fedora Linux ? Nobody wants to reinstall FC 6 or Fedora Linux again!

Almost all versions of Microsoft Windows (including XP, Vista and old versions) overwrite GRUB bootloader in MBR (master boot record). As a result Windows boot loader becomes a new boot loader and GRUB will not appear on screen (you will not able to see GRUB menu options).

But don't worry you can easily fix the problem. Please note that if you are using Debian or Ubentu Linux just follow these instructions. Following instuctions are Fedora Linux only and should work with RHEL / CentOS too:

Step # 1: Boot from Fedora Core Linux 1st CD or DVD

Set BIOS to boot from CD/DVD rom. At boot: prompt type command linux rescue
boot: linux rescue

Just follow on screen instructions, when prompted let installer search Linux installation. If the search operation is successful, your old Linux installation will be available at special directory called /mnt/sysimage.

Step # 2: Prepare system for GRUB reinstallation

Type the following commands at shell prompt:
# chroot /mnt/sysimage
# cd /boot/grub

chroot command allows to run rest of all *COMMAND* with root directory set to NEWROOT called /mnt/sysimage. Without chroot environment you will not able to restore GRUB on Fedora Core 6.

Step # 3: Find out your GRUB bootloader installation location

If you have only one IDE hard disk default should be /dev/hda. You can use any of the following command to determine your device name:
# grep '#boot' grub.confOuput:

#boot=/dev/sda

Above output clearly point out that /dev/sda device where my GRUB bootloader was previously installed.

You can also try out fdisk -l command to list partitions and disk information:
# fdisk -l

Step # 4: Reinstall GRUB

Use grub-install command to install GRUB on your drive /dev/sda
# grub-install /dev/sda

Please note that if above command returned any error return with --recheck option to probe a device map even if it already exists
# grub-install --recheck /dev/sda

Step # 5: Reboot system

Exit from chrooted environment and reboot Linux:
# sync;sync;exit;exit
# reboot

Now GRUB will be able to boot both Windows Vista and Fedora Core 6. In UNIX/Linux dd command can be used to backup and restore the MBR :)

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Keith Says:

    Excellent! Just what I needed!

  2. Wayne Craig Says:

    I have installed Windows Vista on a seperat hard drive. Windows XP Home edition was running fine I installed the new hard drive and then installed Windows Vista Home Premium on the new drive. Did not use dual boot at the time of installation. How do I institute Bual boot from here?

  3. kingless Says:

    thanks a lot :)

  4. John Says:

    This was very useful, I fixed my installation in few minutes.

  5. bhatta Says:

    Thanks mate. The solution worked perfect. Even a novice like me could understand and execute. Thanks again

  6. peter Says:

    Thankyou-now I can boot linux

  7. ahmed barakat Says:

    very nice steps, but when I start the rescue, it tells me it failed to mount some parts of my system,
    the problem that after changing the root
    I find that /dev’ folder has no devices
    so grub-install gives error: “can’t find /dev/hda, or it’s not a block device”
    Do u have any idea how can I handle that please send to me on my personal mail ahmedbarakat@gmail.com
    It’s very important I have a lot of data on my fedora core 6 installation, I don’t want to reinstall it

    Best Regards,
    Ahmed Barakat

  8. Deepak Says:

    Your note has saved me so many hassles. Thanks.

  9. constantine Says:

    hi i installed vista and then linux fedora8 then i formated the partition that the linux was on how can i fix my boot sector to work on vista again please help

  10. JM Says:

    Hi, I think you have to boot with the Vista CD/DVD and use the repair utility. Don’t know on Vista but on XP/2000 the command was FIXMBR. It’s seam that’s Vista as overtaken the mbr whitout asking on my multiboot system, that’s bad.

  11. Naba Says:

    the following error message appear when attempting to logon from my Linux desktop….

    When I attempt to log in as as user i’m seeing the following error directly after entering the password and username.

    “Your session only lasted less that ten seconds. If you have not logged out yourself, this could mean that there is some installation problem or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you can fix the problem”

    Checkbox - View Details (~/.xsession-errors file) which when checked dsiplays the following.

    /home/user/.Xclients: line 8: /home/user/.Xclients-default: No such file or directory

    /home/user/.Xclients: line 8: exec: /home/user/.Xclients-default: cannot execute: No such file or directory

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.