You are not logged in.

#1 2008-10-17 16:24:21

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

XP MBR crushed

Hello. I was reinstalling arch on my eeepc 1000H when I accidentally wrote grub to the XP partition I have, instead of writing it in sda without suffix number... Now I can't boot into XP. I suppose the partition is intact, the only problem is that the XP bootloader (correct me if I'm wrong) has been replaced by grub. Is there a way of recovering it? I have no external cd reader...

Offline

#2 2008-10-17 16:56:26

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: XP MBR crushed

I'm not sure if this is right at this kind of problem too, but you can try to boot from you WinXP-CD, enter the recovery-console and execute "fixmbr".
This is what you should do if you have had Win and Linux on a PC (GRUB as Bootloader) and just deleted the Linux-partitions.

You can also try RIPLinux with it's recovering tools to write a new MBR.
=> http://www.linux.com/feature/147591
=> http://www.tux.org/pub/people/kent-robo … linux/rip/

Last edited by muunleit (2008-10-17 16:57:10)


"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#3 2008-10-17 17:22:17

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: XP MBR crushed

<nevermind>

-dav7

Last edited by dav7 (2008-10-17 18:47:31)


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#4 2008-10-17 18:22:48

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: XP MBR crushed

Actually I don't believe "crash" was meant, but rather "crush" in the meaning of "destroyed"/"overwritten". But I'm no native speaker.

The XP boot loader is called NTLDR and I found the following guide which might help to solve the problem: http://www.tinyempire.com/notes/ntldrismissing.htm

Offline

#5 2008-10-17 23:10:17

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Thanks for your answers. Yes wuischke, that was what I meant, I accidentally wrote GRUB to /dev/sda1 insteado of /dev/sda. Hey but no offense, don't edit the post wink

I have just tried all the options that ntldr recovering floppy gave me but no luck. Maybe my only hope is an external cd drive and booting an xp cd recovery console. However, I have never received an NTLDR missing message when trying to boot windows, it simply goes back to GRUB menu after less than half a second, I just suppossed I crunched my NTLDR because I installed GRUB in the XP partition, no the MBR, I think I am not wrong in that...

Offline

#6 2008-10-17 23:58:17

SkonesMickLoud
Arch Linux f@h Team Member
From: The D of C
Registered: 2008-09-20
Posts: 178

Re: XP MBR crushed

Why not just boot Windows from GRUB?

Boot the Linux GRUB entry, becocme root, edit /boot/rub/menu.lst and look for a section (should be down near the bottom) that looks somewhat like this:

title Windows XP
root (hdx,y)
makeactive
chainloader +1

If it's not there, add it.

x being the HDD number (this is 0 if you only have 1 HDD) and y being the partition number.  GRUB starts numbering at 0, so 1 = 0, 2 = 1, etc.  i.e: /dev/sda1 would be (hd0,0).  /dev/sdb5 would be (hd1,4).

Save.

Reboot.

Boot into Windows.  If it works, you're done.

Last edited by SkonesMickLoud (2008-10-18 00:00:55)

Offline

#7 2008-10-18 00:07:43

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Hi SkonesMickLoud. That is the point. I DO HAVE the GRUB entry, but it will not boot XP. My guess so far has been that while reinstalling arch, when it asks for the GRUB install location, instead of /dev/sda I told it /dev/sda1...

In fact, the XP entry looks exactly like that, but appart from the GRUB, booting into XP requires it's own bootloader (that is what I think, if I am not wrong). So I'd bet my xp partition is intact except from it's own bootloader, the infamous NTLDR.

Without an external CD drive I can not get into the recovery console, so I have been trying usb/floppy (I do have an external floppy drive, I thought I'd never use it) distros/bootdisks.

I must say all I have said is my guess so far, I haven't mounted the xp partition and maybe it is wrong, it has somehow been corrupted... but I don't think so as the only thing I have done in my eee is reinstalling arch, and choosing a wrong bootloader location...

Offline

#8 2008-10-18 01:14:28

SkonesMickLoud
Arch Linux f@h Team Member
From: The D of C
Registered: 2008-09-20
Posts: 178

Re: XP MBR crushed

Sorry, I read yout post wrong.  What error code does GRUB give you when you try to boot XP?

Offline

#9 2008-10-18 15:07:58

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

It doesn't give a message, it simply jumps back to the grub menu, almost instantly. There is no NTLDR missing error, but I supposse that is the problem...

Offline

#10 2008-10-18 19:49:29

OneEyedPimp
Member
Registered: 2008-05-02
Posts: 103

Re: XP MBR crushed

Ok, so xp was on /dev/sda1 and then your wrote grub to this partition? Could you not mount this partition, and steal a NTLDR from a working machine? and then reinstall grub into /dev/sda MBR?

If this is stupid, please excuse me I, I thought that the NTLDR was not specific to the machine...

Offline

#11 2008-10-19 21:31:01

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Well, I actually don't have Windows on any of my machines. I just have it virtualized in VirtualBox. Anyway, I don't know how to "steal" the NTLDR. If I am not wrong I have GRUB both, in the partition and in /dev/sda (from the previous successful install of Arch). Is the NTLDR just a file or more? If it is, I could copy it/them mounting the XP partition from arch. I am beginning to think the best idea will be to ask someone who has an external cd drive and to reinstall XP, however I usually like to fight a bit before giving up ^_^

Offline

#12 2008-10-20 01:22:59

Execute_Method
Member
From: Tennessee
Registered: 2008-07-26
Posts: 105

Re: XP MBR crushed

This should work:

Boot from the windows XP CD, press the "R" key in the setup in order to start the restoration console.
Select your windows XP installation from the list, and enter the administrator password.
Enter the command: FIXMBR and confirm the next question with a Y.
Use exit to restore the computer.

Offline

#13 2008-10-20 15:52:00

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Thanks Execute_Method, I've read that is the simplest way to do it. However I first must aquire an external cd drive, I have tried booting from floppy disks and pendrives but nothing...

Offline

#14 2008-10-20 16:36:18

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: XP MBR crushed

The MBR as used by windows can be had from the web - just google for MBR. Make sure you only use the first 446 bytes of it though, otherwise you will clobber the partition table.
Also - if you have a windows-floppy, even one with windows-95/98, the MBR is the same, just dd off the first 446 bytes and then dd this onto your 'sda' ...

The MBR is 512 bytes long, but the partition table is 64 bytes long and there are an additional 2 bytes at the end - 0xaa and 0x55 (or is it the other way around?) as a 'stamp' that this is indeed a windows MBR ...

If you download from the web, it will often be in a hex format and you will need to translate this into binary - there are usually descriptions on how to do this when you find the mbr.hex file ...

Offline

#15 2008-10-20 17:08:00

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Thanks perbh but that didn't work. Now it says:

Loading stage2Read Error

And it stops there. I must say it didn't say anything before, no messages, just going back to GRUB menu. This is what I did:

dd if=/dev/sdb bs=1 count=446 of=/dev/sda1

Last edited by Hiperi0n (2008-10-20 17:09:34)

Offline

#16 2008-10-20 17:31:09

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: XP MBR crushed

Ahhhh - but you should've used /dev/sda and not /dev/sda1 !!
If you use the windows MBR, then whatever partition you want to boot must be the _active_ partition (use fdisk if you have to).

Though, when all this is said and done, I'd far rather have grub on the MBR and let grub boot eg. windows - as indicated somewhere above. Even if you have only windows, you can still install grub and use grub to boot it - it's a bit more difficult the other way though ...

When I dualboot between vista and linux, I have to do it this way. Install grub on the root of the partition with linux (say sda3 - vista using sda2 and vista recovery sda1) and set sda3 as the active partition. Windows MBR will then try to boot from sda3 and that in turn will bring up grub which I can then use to boot vista or linux ...
The only problem is whenever vista updates itself - it will change the active partition back to sda2 ... :-(
Then I just use anything with fdisk on it and set sda3 back as the active partition and I'm good to go again.

Offline

#17 2008-10-20 17:35:59

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Thanks, but I don't think you get the point perbh. I have writteng grub to /dev/sda1 and /dev/sda, so I wiped out whatever first bytes of the XP partition so I now can't boot into windows, even if my mbr is okay. Isn't NTLDR what I have erased from the xp partition? Maybe it is all screwed up and I have my xp partition a mess, but I doubt as the only change I made to my HD was reinstalling arch and installing GRUB into /dev/sda1 instead of /dev/sda (the MBR, if I am not mistaken).

Is there a solution for this? I have no windows xp available and all the pendrive-xp-install-cd methods involve using windows! :-(

Offline

#18 2008-10-20 17:36:25

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: XP MBR crushed

Caution. Don't equalize bootloader with MBR.  The thread starter overwrote the bootloader inside the windows partition (which I suppose is called by the bootloader in the MBR) and wants to restore this one, not the MBR which is rightfully occupied by GRUB.

Offline

#19 2008-10-20 17:37:39

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: XP MBR crushed

Oooops - guess I didn't read your initial posting well enough ... sorry.
You do want grub on the MBR, you want to use grub to boot either windows or linux - right?
OK,
Obviously you can boot into your linux partition, so the MBR and hence grub works, you just cannot boot into xp.
So - you edit /boot/grub/menu.lst and add the following section:
title windows xp
  rootnoverify (hd0,0)     # because xp is on the _first_ partition
  makeactive
  chainloader +1

Sorry about my previous rantings ...

{edit} I don't think the boot sector of (say) sda1 is involved, but I may be wrong ...

Last edited by perbh (2008-10-20 17:40:27)

Offline

#20 2008-10-20 17:42:48

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: XP MBR crushed

perbh wrote:

Oooops - guess I didn't read your initial posting well enough ... sorry.
You do want grub on the MBR, you want to use grub to boot either windows or linux - right?
OK,
Obviously you can boot into your linux partition, so the MBR and hence grub works, you just cannot boot into xp.
So - you edit /boot/grub/menu.lst and add the following section:
title windows xp
  rootnoverify (hd0,0)     # because xp is on the _first_ partition
  makeactive
  chainloader +1

Sorry about my previous rantings ...

{edit} I don't think the boot sector of (say) sda1 is involved, but I may be wrong ...

This won't work either, because he has overwritten his NTLDR on his windows partition.
I think this is what you are looking for.

Offline

#21 2008-10-20 21:46:07

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Thanks Misfit138, that is the problem. I also confused MBR/NTLDR/bootloader words. I do have the GRUB entry, but XP won't boot. The recovery console method will have to wait as I my eee does not have a cd drive. I have been trying with pendrives but no luck so far...

Offline

#22 2008-10-21 00:22:32

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: XP MBR crushed

But then - should he not get the (in)famous "ntloader not found" ?
Unless the nt-loader is on the boot sector of sda1 (which it may be, but that would seem strange), all he would accomplish by installing grub on sda1 would be the boot sector and the boot and/or grub directory?

Mind you - if he mounts sda1 within linux, it would be easy to see whether or not the nt-loader actually _is_ there ...

Offline

#23 2008-10-21 09:47:28

TjPhysicist
Member
From: Waterloo, Canada
Registered: 2008-04-12
Posts: 126
Website

Re: XP MBR crushed

umm when using grub, with ntldr errors grub jst takes the screen back right away. The meesage is displayes but too fast for human eyes. There IS a way to pause it however, i cant remeber. Also the windows partition has to be the *activee* one on your system, or else windows will not boot.


-Tj
Now reborn as Tjh_ (to keep it similar to my username in other places)

Offline

#24 2008-10-21 16:07:00

Hiperi0n
Member
Registered: 2008-06-17
Posts: 49

Re: XP MBR crushed

Well, maybe it was too fast, but after writing the 446 bytes from a boot floppy directly (dd) into /dev/sda1, I now get the error I posted earlier. I suppose I can mount the partiton, but I am not sure I'd accomplish anything, the easiest solution is aquiring an external CD drive and fixing the NTLDR with the recovery console...

Offline

#25 2008-10-22 19:46:54

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: XP MBR crushed

Yes indeed - but what if the NTLDR is there? Then you are barking up the wrong tree.
You can even mount it r/o to be on the safe side ...

Offline

Board footer

Powered by FluxBB