You are on page 1of 9

3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…

ubuntu.com - launchpad.net - ubuntu help

Search
O r, Sign in using your Launchpad ID

Ubuntu Forums > The Ubuntu Forum Community > Other Community User Name User Name Remember Me?
Discussions > Tutorials & Tips
Grub/XP/Vista Bootloader Password Log in

Register Reset Password Forum Help Forum Council Today's Posts Search

Tutorials & Tips


The place to find Ubuntu related Tips & Tricks.

New Reply Page 1 of 37 1 2 3 11 > Last »

Thread Tools Display Modes

December 18th,
#1
2008

talsemgeest Grub/XP/Vista Bootloader


Fresh Brewed
Ubuntu
How to restore the
Ubuntu/XP/Vista/7 bootloader
(Updated for Ubuntu 10.10)
This How-to is for windows dual booters w ho reinstall an operating system only to find that it has taken aw ay
access to their other operating system.
W hether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide w ill walk you through it.

Join Date: Oct All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here.
2007
Location: If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the
Auckland, New previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader
Zealand back, but want to get the vista bootloader back, simply follow my instructions for installing the vista
My beans are bootloader.
hidden!
Ubuntu 10.10
Maverick Meerkat
How to restore the Ubuntu grub bootloader (9.10 and
beyond)
First you need to find out w hat your drives are called. You can do this by going to a terminal and typing:
Code:
sudo fdisk -l

You will get something like this:

ubuntuforums.org/showthread.php?t… 1/7
3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…

From that you need to find the device name of your Ubuntu drive, something like “/dev/sda5″.
So, still in the terminal, type:
Code:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5

And then, to reinstall the grub:


Code:
sudo grub-install --root-directory=/media/sda5 /dev/sda

Push enter and you’re done! Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found
in the fdisk output.

How to restore the Ubuntu grub bootloader (9.04 and


older)
First of all, all credit for this part of the tutorial goes to catlet. I am simply rew riting his tutorial to have all
three bootloaders in this tutorial.

So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.

Once there, open a terminal (Applications>Accessories>Terminal) and type this:

Code:
sudo grub

Next, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this
command:

Code:
find /boot/grub/stage1

Take note of what it returns (something like (hd0,1).)

Now you need to tell Grub w here it is installed. Using the output of the last command, change this one and
run it:

Code:
root (hd<a>,<b>)

Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1" gave me "

ubuntuforums.org/showthread.php?t… 2/7
3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…
(hd0,1)", you would run "root (hd0,1)"

Ok, so thats the configuration over and done w ith. Now w e just need to run one command to install the Grub
to your hard drive:

Code:
setup (hd0)

Now to quit and check if it has w orked:

Code:
quit

Code:
sudo reboot

Make sure you have taken the live cd out of your disc tray. All going well, you should start back up and see
the grub once again.

How to restore the Windows XP bootloader


For this you will need your W indows XP installation CD. Boot into it now.

You will get to a part w here it asks if you w ant to repair or recover. To do so, press "r".

If prompted, enter your Window s XP administrator passw ord. This w ill leave you at at a command line, so
type in the follow ing tw o commands:

Code:
fixboot

Code:
fixmbr

Then type
Code:
exit

then remove your XP cd. If everything has gone well, you should come to your XP bootloader.

How to restore the Windows Vista or 7 bootloader


To restore the Window s Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come w ith a Vista/7 installation disk, you can get the
same effect with a Vista recovery disk, which you can dow nload for Vista or W in 7.
W hen you get to the Regional settings, select your Location/Keyboard setting then click next. On the next
page you must click on "Repair your computer."

On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking
next.
Then click on "Command prompt". From there, type in the folow ing:

Code:
bootrec.exe /fixboot

July 6th, 2009 #2

maxideci Code:Re: Grub/XP/Vista Bootloader


5 Cups of Ubuntu bootrec.exe
Hi, /fixmbr

Nice tutorial there, I will work on it, but, I am not sure if the situation I find myself is same or
not.
Now close the tw o windows and click "Restart."
Join Date: Feb 2009 I have Dell Studio with preinstalled Vista Home SP1.
Beans: 33 Take outIyour
made a 20 GB
Vista/7 raw
DVD and partion and installed
hopefully, Linux
you w ill be left w
with
ith Grub
your Bootloader.
W indows Vista/7 Bootloader.
__________________
On the initial boot screen (Grub), I see option of selecting Linux or W indows.

ubuntuforums.org/showthread.php?t… 3/7
3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…

Next, using EasyBCD, I configured the Vista bootloader to show boot option of Microsoft
Vista and Linux.

Currently, this is how the boot sequence is on my notebook.


->Initial boot screen : Grub (1-Linux, 2-Windows Vista)
->Once I select Window s, I get is another boot selection option 1-Microsoft Vista, 2-Linux.

What I prefer is to have only one boot option screen that is second one (Which i suppose is
Windows Vista's bootloader), at the same time I want to keep Linux partition intact.

Simply putting it, I want to get rid of Grub bootloader, without getting rid of Linux partition.

If I follow your tutorial w ill I be able to achieve it ???

What is the standard procedure to install Linux, on a system with MS Vista, without
disturbing the bootloader?

thanks in advance.

cheers!!

July 6th, 2009 #3

talsemgeest Re: Grub/XP/Vista Bootloader


Fresh Brewed Ubuntu Quote:
Originally Posted by maxideci
Hi,

Nice tutorial there, I will work on it, but, I am not sure if the situation I find myself is
same or not.

I have Dell Studio with preinstalled Vista Home SP1.


I made a 20 GB raw partion and installed Linux with Grub Bootloader.

On the initial boot screen (Grub), I see option of selecting Linux or Windows.
Join Date: Oct 2007
Next, using EasyBCD, I configured the Vista bootloader to show boot option of Microsoft
Location: Auckland, New
Vista and Linux.
Zealand
My beans are hidden!
Currently, this is how the boot sequence is on my notebook.
Ubuntu 10.10 Maverick
->Initial boot screen : Grub (1-Linux, 2-Windows Vista)
Meerkat
->Once I select Windows, I get is another boot selection option 1-Microsoft Vista, 2-
Linux.

What I prefer is to have only one boot option screen that is second one (Which i
suppose is Windows Vista's bootloader), at the same time I want to keep Linux
partition intact.

Simply putting it, I want to get rid of Grub bootloader, without getting rid of Linux
partition.

If I follow your tutorial will I be able to achieve it ???

What is the standard procedure to install Linux, on a system with MS Vista, without
disturbing the bootloader?

thanks in advance.

cheers!!

Ok, the easiest thing to do is to use easybcd to remove the option of linux, then to reinstall
the grub bootloader, which should give you your one bootloader screen, and still allow you
to access both ubuntu and w indows.

Your other option is to reinstall the vista bootloader, and edit the grub so it only has one
option.

It is up to you
__________________
Quote:
First they ignore you, then they laugh at you, then they fight you, then you win ~
Mahatma Gandhi

August 30th, 2009 #4

Diamond.Dave Re: Grub/XP/Vista Bootloader


First Cup of Ubuntu
ubuntuforums.org/showthread.php?t… 4/7
3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…
Ok, so I hosed something up...
System: Dell D820, 2 GB RAM, 80GB HD, T5500 processor
I've been playing w ith both XP and Ubuntu, and finally settled on a dual boot. So, I read
through all the threads and it seemed to say that it w as best to start with WinXP and then
Join Date: May 2009 boot up in to ubuntu and tell it to do a side by side install>
Beans: 10 Put in the WinXP disk, had it wipe all the partitions (there w ere many) back to 1 big partition.
Ubuntu 9.04 Jaunty Got XP set up. Then put in the Ubuntu disk, told it to side by side install - it did, then said it
Jackalope needed to reboot...

now I get GRUB Loading stage1.5.


GRUB loading, please w ait...
Error 22

I tried the above thread to reload the Ubuntu grub - no joy, still get the Error 22. So I loaded
the Ubuntu CD and ran fdisk -l:

ubuntu@ubuntu: ~$ sudo fdisk -l

Disk /dev/sda:80.0 GB, 80026361856 bytes


255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x41ab2316

Device Boot Start End Blocks Id System


/dev/sda1 * 1 9729 78148161 7 HPFS/NTFS

I'm not an expert, but to me, I don't see where there's a Ubuntu partition here...am I
missing something?

August 30th, 2009 #5

Diamond.Dave Re: Grub/XP/Vista Bootloader


First Cup of Ubuntu Ok, might have solved my ow n problem. I ran the above W inXP recovery, including fixboot
and fixmbr, and it booted fine. Then, in Computer Management, I looked at Disk
Management, and it ONLY shows the C: partition...guess I messed up the Ubuntu load...will
let you know after I try again!
Thanks!
Join Date: May 2009
Beans: 10
Ubuntu 9.04 Jaunty
Jackalope

August 30th, 2009 #6

Diamond.Dave Re: Grub/XP/Vista Bootloader


First Cup of Ubuntu Yeah! So it worked - actually follow ed the dual-boot instructions and setup the partitions
ahead of time...all is well now ! Thanks for the thread.

Join Date: May 2009


Beans: 10
Ubuntu 9.04 Jaunty
Jackalope

August 31st, 2009 #7

talsemgeest Re: Grub/XP/Vista Bootloader


Fresh Brewed Ubuntu No problem, always glad to help!
__________________
Quote:
First they ignore you, then they laugh at you, then they fight you, then you win ~
Mahatma Gandhi

Join Date: Oct 2007


Location: Auckland, New
Zealand
My beans are hidden!
Ubuntu 10.10 Maverick
Meerkat

ubuntuforums.org/showthread.php?t… 5/7
3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…

September 26th, 2009 #8

emeraldgirl08 Re: Grub/XP/Vista Bootloader


Ubuntu Extra Shot Hey member me??!!!

Good to know I bookmarked this as reference! Needed it this evening


__________________
Leno vo Think pa d T400 7417-CTO
Ubuntu 10.04LTS/W 7/XP

Join Date: Apr 2009


Location: Southwest,
Arizona
Beans: 363
Ubuntu 10.04 Lucid Lynx

September 26th, 2009 #9

talsemgeest Re: Grub/XP/Vista Bootloader


Fresh Brewed Ubuntu Quote:
Originally Posted by emeraldgirl08
Hey member me??!!!

Good to know I bookmarked this as reference! Needed it this evening

Haha, cool, happy to help again. I will be making a few screencasts to accompany this post,
so that should be done in a few days.
__________________
Quote:
Join Date: Oct 2007
Location: Auckland, New First they ignore you, then they laugh at you, then they fight you, then you win ~
Zealand Mahatma Gandhi
My beans are hidden!
Ubuntu 10.10 Maverick
Meerkat

September 27th, 2009 #10

bresdog Re: Grub/XP/Vista Bootloader


5 Cups of Ubuntu Put xp on an old laptop of mines that already had ubuntu, and obviously the GRUB menu has
gone. Followed these steps and i've gotten this error message-

Checking if "/boot/grub/stage1" exists... yes


Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed
Join Date: Jul 2008
Location: Ireland Error 12: Invalid device requested
Beans: 28
Ubuntu 9.04 Jaunty Tried the suggestions here aswell-
Jackalope https://help.ubuntu.com/community/Re...tallingW indows

Any thoughts? Im still learning this stuff, any help is greatly appreciated. Soon i'll hopefully
be giving advice back! Thanks
__________________
"if he dies, he dies" - nemanja vidic

New Reply Page 1 of 37 1 2 3 11 > Last »

ubuntuforums.org/showthread.php?t… 6/7
3/7/2011 Grub/XP/Vista Bootloader - Ubuntu Fo…
Bookmarks

Digg del.icio.us StumbleUpon Google

Tags

bootloader, grub, repair, vista, win xp

« Previous Thread | Next Thread »

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 On
HTML code is Off
Forum Jump
Forum Rules Tutorials & Tips Go

-- CleanV2 ubuntu forums - archive - top

vBulletin ©2000 - 2011, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop
Project. lingonberry

ubuntuforums.org/showthread.php?t… 7/7
ERROR: undefined
OFFENDING COMMAND:

STACK:

You might also like