You are not logged in.

#1 2008-07-30 17:24:57

PrimoTurbo
Member
Registered: 2008-06-26
Posts: 109
Website

[Solved]How to fix grub after Windows XP install?

I installed Windows XP on top of Arch in a different partition.

It looks something like this:

/dev/sda1 - XP
/dev/sda2 - Arch
/dev/sda3 - Swap

Grub is located on /dev/sda2/ in /boot/grub/

Windows XP obviously overwritten the mbr like it normally does.

I tried loading the arch live install cd, and trying grub-install /dev/sda and /dev/sda1 and /dev/sda2 but it doesn't do anything.

I want to overwrite Windows XP's boot loader with grub and add XP as an option to boot. Can someone please give me noob friendly instructions on how to accomplish this with minimal effort? It's important I don't damage the XP or Arch partitions. Thanks for any help.

Last edited by PrimoTurbo (2008-07-30 18:06:43)

Offline

#2 2008-07-30 17:29:02

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [Solved]How to fix grub after Windows XP install?

One of the ways: download, burn and boot RIP (version with GRUB), press C when presented with GRUB, input "root (hd0,1)" and "setup (hd0)". Boot into Arch, add WinXP to /boot/grub/menu.lst. Keep RIP for any possible future emergencies.

Last edited by lucke (2008-07-30 17:33:24)

Offline

#3 2008-07-30 17:39:45

PrimoTurbo
Member
Registered: 2008-06-26
Posts: 109
Website

Re: [Solved]How to fix grub after Windows XP install?

Is it possible to do this with just Arch Live cd? Thanks for your help btw.

Last edited by PrimoTurbo (2008-07-30 17:39:56)

Offline

#4 2008-07-30 17:53:03

PrimoTurbo
Member
Registered: 2008-06-26
Posts: 109
Website

Re: [Solved]How to fix grub after Windows XP install?

I tried to do the following in arch live cd.

mount /dev/sda2 /mnt/linux (mounts fine)
grub-install /dev/sda2

I get "Could not find device for /boot: Not found or not a block device."

Offline

#5 2008-07-30 18:05:53

PrimoTurbo
Member
Registered: 2008-06-26
Posts: 109
Website

Re: [Solved]How to fix grub after Windows XP install?

I fixed it! Nearly the same instructions as lucke gave but I just used the Arch Live cd. All I did was boot Arch Live cd, it presented me with grub and bunch of options. (I didn't even boot into the cd) just pressed C so it loaded the grub terminal.

Then:

find /boot/grub/stage1

Which outputs:

root (hdX,Y)

(In my case it was hd0,1)

Then:

root (hdX,Y)

[Don't forget there is space after root and (hdX,Y)]

Finally:

setup hd0

Offline

#6 2008-07-30 18:06:39

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [Solved]How to fix grub after Windows XP install?

what you need to do is:

1) Boot with an Arch install CD
2) create a mountpoint (for example "mkdir /mnt/sda2") and mount Arch partition there
3) edit /mnt/boot/grub/menu.lst to add Windows to grub menu, check that other info is correct in there as well
4) grub-install --root-directory=/mnt/sda2 --recheck /dev/sda

That should be it. 

"man grub-install" if you need more info.

EDIT: too late wink

Last edited by fwojciec (2008-07-30 18:07:01)

Offline

#7 2008-07-30 18:50:27

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [Solved]How to fix grub after Windows XP install?

Nice you didn't need RIP - I wasn't aware that the new Arch install CD comes with GRUB.

Offline

#8 2008-08-15 00:16:00

arfett
Member
Registered: 2008-04-26
Posts: 11

Re: [Solved]How to fix grub after Windows XP install?

I have the same loadout except:

sda1: XP
sda2: ntfs storage partition
sda3: Arch

None of this is working for me.  When I type "root (hd0,1)" into the grub console it tells me "Filesystem type unknown, partition type 0x7" and if do "setup hd0" it tells me "Error 11: Unrecognized device string."

Can anyone shed some light on this?

PS.  I think Primo Turbo left out a step since after he says "Which outputs:" and "Then" he pasted the same exact thing "root (hdX,Y)"

Offline

#9 2008-08-15 00:49:32

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: [Solved]How to fix grub after Windows XP install?

arfett wrote:

PS.  I think Primo Turbo left out a step since after he says "Which outputs:" and "Then" he pasted the same exact thing "root (hdX,Y)"

the "Then" part is where Primo Turbo is telling grub that the root of the filesystem is to be found on (hdX,Y) which in his case is /dev/hda2 or in grubspeak (hd0,1).

Offline

#10 2008-08-15 00:55:43

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: [Solved]How to fix grub after Windows XP install?

arfett wrote:

None of this is working for me.  When I type "root (hd0,1)" into the grub console it tells me "Filesystem type unknown, partition type 0x7" and if do "setup hd0" it tells me "Error 11: Unrecognized device string."

your telling grub here that your root filesystem is on your ntfs partition.
I think you should try root (hd0,2) as that would point to your arch partition.

Offline

#11 2008-08-15 01:20:45

arfett
Member
Registered: 2008-04-26
Posts: 11

Re: [Solved]How to fix grub after Windows XP install?

That fixed one issue.  I still get "Error 11: Unrecognized device string"  when I type "setup hd0"

Offline

#12 2008-08-15 01:26:54

arfett
Member
Registered: 2008-04-26
Posts: 11

Re: [Solved]How to fix grub after Windows XP install?

I fixed the issue... somehow.  Instead of using the Grub console I chose "Tools" from the Arch CD and one of the options was install GRUB to the MBR.  I edited this and had it do EXACTLY what I was typing in 2 seconds ago that failed and it automagically did it and now GRUB boots fine.

Thanks for the help, guys.

EDIT* - Great.  Now XP isn't booting from GRUB.  "Error 12: Invalid device requested"

rootnoverify (hd0,0)
makeactive
chainloader +1

This should boot it, right?

Last edited by arfett (2008-08-15 01:29:34)

Offline

#13 2008-08-17 00:25:25

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: [Solved]How to fix grub after Windows XP install?

Try it without the makeactive line, thats what I did to solve a similar problem getting into XP/Vista on a friends machine which was multi booting Vista/XP/Ubuntu/Arch with grub as the bootloader.

Offline

Board footer

Powered by FluxBB