Fix a dual boot Windows Vista and Linux problem

by on November 22, 2006 · 23 comments· LAST UPDATED January 8, 2008

in , ,

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 :)

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 23 comments… read them below or add one }

1 Keith January 19, 2007 at 8:11 pm

Excellent! Just what I needed!

Reply

2 Wayne Craig March 2, 2007 at 3:09 pm

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?

Reply

3 kingless April 21, 2007 at 10:52 pm

thanks a lot :)

Reply

4 John May 10, 2007 at 9:35 pm

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

Reply

5 bhatta October 3, 2007 at 4:27 pm

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

Reply

6 peter November 1, 2007 at 8:16 am

Thankyou-now I can boot linux

Reply

7 ahmed barakat January 5, 2008 at 5:06 pm

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

Reply

8 Deepak January 28, 2008 at 8:03 pm

Your note has saved me so many hassles. Thanks.

Reply

9 constantine April 21, 2008 at 11:37 pm

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

Reply

10 JM May 25, 2008 at 8:23 am

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.

Reply

11 Naba June 21, 2008 at 12:03 pm

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

Reply

12 afeez August 3, 2008 at 2:02 pm

hey installed server 2008 them redhat linux. now my system is now booting 2 windows. the linux just doesnt allow for windows 2 boot, as in it doesnt give even give any option for this 2 happen. plz help.

Reply

13 Joevn August 13, 2008 at 1:56 pm

I have install Wins Vista and then Linux Ubuntu, the boot system working fine till, I uninstall Ubuntu, the Vista Boot sector wouldn’t work again. I have tried to put the Visa CD installer to the boot system. However, the system recover denied the access to configuration due to vista require administrator password. But I don’t remember the vista Administrator password, or i don’t think i even set one for it. Could you tell me how to clear Administrator password, please? Or anyone have any suggestion to overcome and fix my vista booting sector. THANKS, Mate

Reply

14 Sirajuddin December 16, 2008 at 6:35 am

Thanks very much. Its very useful. Can anyone tell me how to get a subscription or login permit to this nixcraft.

Reply

15 Henry February 17, 2009 at 7:12 pm

This has been of great help to me. Worked perfectly and saved me weeks of misery and tens of attempts ‘successfully’ reinstalling Fedora Linux and having the system boot straight to Windows Vista as if the Linux installation did not happen.

Reply

16 matrix April 11, 2009 at 3:44 pm

that was great. thx a lot…

Reply

17 dee April 19, 2009 at 4:37 pm

THANKS!!!! help me a lot!

Reply

18 Sami February 5, 2010 at 1:48 pm

Thank you! This is what I needed

Reply

19 amir February 6, 2011 at 8:18 am

hi guys i have win vista-after that i install linux centos now when i was in vista i format the drive that linux install on it.now linux boot show up like every time but no option to select black screen of gnu grub of centos show up now i can’t go to vista help me what should i do?
thanks

Reply

20 Mike March 18, 2011 at 5:06 am

Thanks. I followed the steps and everything works.

Reply

21 Adam July 8, 2012 at 4:55 pm

Hey I have the opposite problem! Every time i start my computer it starts with ubuntu linux and i need to boot with Windows Vista! How do i fix this so i can boot windows???

Reply

22 Adorn September 3, 2012 at 3:34 am

@Adam: Just Update grub or add windows entry manually.

Reply

23 Pankaj June 7, 2013 at 4:19 pm

Hi,

I installed RHL 4 successfully to make my laptop to be dual boot alongwith Vista home premimum, RHL option does not come up while booting, so I followed steps given in this blog, I am still unable to fix boot issue.

Please advise.

Thx

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , ,

Previous post:

Next post: