Fun restoring WinXP after Win7 install with Linux Grub boot manager

I spent a silly amount of time today (about 60 minutes) restoring grub to boot WinXP after my wife installed Windows7 on to her relatively new PC. I suspect a faux-pas on my part complicated the recovery. :frowning:

**Some background **

Her PC has an IDE drive and a SATA drive.

  1. WinXP is on sda1 of the IDE drive, and sda2 on the IDE drive is an extended partition, inside which is an NTFS storage area. sda1 was the active partition on this drive.
  2. NTFS storage is on the sdb1 of the SATA drive, and sda2 on the SATA is an extended partition, inside which is sda5, sda6, and sda7 which are swap, / , and /home of openSUSE-11.3. sda2 was the active partition on this drive. Also, the SATA drive was the default boot drive in BIOS.

sda and sdb are as ‘assigned’ by openSUSE-11.4. She decided to install Windows7 on sdb1 of the SATA drive.

**Backup MBR with dd **

Before she installed, I backed up the MBR for both sda and sdb using the dd command and copied it to a memory stick. I also booted to parted magic liveCD and changed the 1st partition on the SATA drive to be the active drive (in preparation for the Win7 install on the 1st partition of the SATA).

Install win7

During Win7 install she chose ‘custom’ and was careful to install Win7 on the 1st partition of the SATA drive (which is the openSUSE-11.3 /sda1). Installation of Win7 went reasonably ok (for windows) although she had no network and no audio after installing. I managed to dig out the motherboard CD and after installing drivers from there she got the network and audio working. Default win7 graphics were horrible on Win7 (with her nVidia G210) but after digging out the custom CD that came with her graphic card and installing graphics drivers from there, the graphics were ‘passable’ (albeit more Win7 tuning needed as openSUSE-11.3 still looks MUCH nicer than Win7).

**restore MBR - the fun starts **

Then we booted back to the parted magic liveCD with the intention of me restoring the MBR from my MBR backups (such that the Linux grub boot manager would run, giving my wife a choice to boot: WinXP, or Win7, or openSUSE). Now it is VERY IMPORTANT to note that winXP is still her main partition where she does ALL of her work. If I lose winXP, my life expectancy on this planet would be severely curtailed.

Before doing anything, I made additional backups of the post win7 install MBR for both drives (which as it turned out I never used).

But to my horror parted magic “may” have labeled the SATA as sda and the IDE as sdb. I say “may” because I was not sure at the time. Now this would not be so serious, except I could not remember if openSUSE had labeled the SATA as sda or sdb. And of course, the name I gave to the backup MBR files did not help … Duuhhhhhh … MAJOR faux-pas on my part , as I know I have the world’s worst memory and I should take more care.

So I flipped a coin, and in parted magic, I copied the backup sda MBR (which I thought was the openSUSE sata, but was not (it was the IDE)) to sda drive of parted magic (which turns out was the SATA drive MBR). ie I put the wrong MBR on the wrong drive. I made the SATA extended partition the active partition, and rebooted.

I figured if I got the MBRs mixed up the PC would simply not boot, and I would know.

Well, the PC booted immediately to openSUSE Linux (YES ! I was happy) and when I selected the windows entry in grub (which used to be winXP) Windows7 booted. My wife was NOT happy. She did NOT want to lose winXP.

After 30 minutes of playing with mappings and a number of reboot tests (with my wife leaning over my shoulder), I could easily boot to openSUSE-11.3 and Win7, but NOT to winXP. Win7 kept coming up each time I tried to boot to winXP. Visions of Win7 destroying the winXP boot danced through my head, and ominous looks from my wife (containing daggers) were bouncing off my already thin skin.

**restore MBR again !! **

Finally, I decided to swap the MBRs of sda and sdb from my 1st set of MBR backups. But my wife’s patience was almost gone now (at about minute 50), so as to avoid my wife being charged with my homicide, we booted to BIOS and made the IDE drive the default drive (as the IDE drive has winXP on it). WinXP booted. Suddenly my wife was not so willing to commit a capital offence.

I was allowed to put the SATA back (in BIOS) as the default drive, so I could fix the grub boot manager.

So I booted to openSUSE, and put grub back to its previous mapping (removing my zillion speculative unsuccessful hacks) and ensured I had a good rootnoverify setting in the menu.lst for winXP.

Rebooted, and once again it worked. We could get winXP ! … whewwww …

The wife’s looks of daggers changed to hearts and once again I was saved. :slight_smile:

Some time I need to learn how this really works.

But its just another day in the oldcpu household, although sometimes I think I’m too old to have this marital stress. :stuck_out_tongue:

Hi oldcpu,

Perhaps you’re trying too hard? It’s not possible to give the same experience in compatibility that windows does, that’s something I learned the hard way with my wife. I was always trying to make things work the same for her with oS as it did with XP, with the only reward that “It’s not the same”, “it’s not working”, “it was working but you did something and it’s not anymore”, “it’s not playing powerpoint correctly”, and so on. But then, I was also maintaining her XP updated, virus free, etc.

Later, when vista was launched, I was totally into oS and didn’t want to spend the time learning/maintaining windows anymore - openSUSE was enough for me, so I (politely) told her: hey dear, it’s your computer, you do whatever you want with it. Only I’m not “au courrant” with windows anymore, so I can’t maintain it for you, you’ll have to do it yourself - or hire someone. Now, if it’s running openSUSE I will gladly maintain it for you.

Guess what os she’s running now… And no more complaints, hard looks or threats, only polite requests to fix something now and then. :slight_smile:

lol ! I do “try” and most of the time I do let her suffer on her own in winXP (and she DOES suffer at times).

But I’m a sap with no strength when it comes to her pleas tied in with a drop of tears from her … my will power quickly vanishes and I’m once again a slave to recovering some windoze product on her PC …(and as everyone knows, my windoze knowledge is truly pathetic) … I should also mention, my wife has learned how to keep enough Linux on her PC so that I don’t desert her totally to her windoze folly. … in this case it was her wanting Linux grub as the boot manager, and me having to ensure it works. …

In truth I can’t really complain. I DID learn a bit, although I’m a bit puzzled as to why it took me 60 minutes. It should have ‘just worked’ !

I think I might open my MBR backups and take a look at them with a hex/binary editor. Maybe that will shed some light on my puzzlement. As noted I’m still a big fuzzy as to what transpired this afternoon and I would like to clear away that fog clouding my technical understanding.

Not married long, are you? :D:D:D

at least you made it :smiley:

I would have ended up in a complete mess and finally a new install. Or I never would have started such a project because I know that I wouldn´t be able to at least understand what I am doing :smiley:

on my desktop I also have two HDDs, on one Windoze is lying around and the other is for openSuse. As I installed oS on it, I was really scared that something breaks, but the oS-installer made it exactly like I wanted!

lol ! Not too long (we are coming up to our 10th anniversary this upcoming December).

I did a comparison of the MBR backup files with ‘dhex’ (a hex editor/comparison program) and confirmed I did confuse the sda MBR backup with the sdb MBR backup.

I originally called the sda backup (which was the IDE drive): MBR-backup-sda-mini2010-440

and after installing win7 on the SATA drive I again backed up the untouched IDE drive, but this time called it sdb: MBR-backup-ide-sdb-win7-440

So I compared MBR-backup-sda-mini2010-440 to MBR-backup-ide-sdb-win7-440 with:

dhex MBR-backup-sda-mini2010-440 MBR-backup-ide-sdb-win7-440 

and obtained:](

which clearly indicates the “before” file that I called “sda” (ie MBR-backup-sda-mini2010-440) was the same as the AFTER file I called “sdb” (ie MBR-backup-ide-sdb-win7-440). Those 2 files being 100% identical proves I mixed up sda and sdb which is a REALLY REALLY silly mistake. Lesson learned !!

Glad I survived that faux-pas. :smiley:

Why use Win. 7 & XP on the same system? Is it some sort of *************?

This is the wife’s PC … not mine.

She is a BIG winXP fan, … actually a BIG Microsoft fan, and she is curious about windows7. But despite being a fan, she is not 100% trustful enough of Microsoft and windows7 to give up winXP for it immediately.

oldcpu wrote:

> RichardET;2320978 Wrote:
>> Why use Win. 7 & XP on the same system? Is it some sort of
>> *************?
> This is the wife’s PC … not mine.
> She is a BIG winXP fan, … actually a BIG Microsoft fan, and she is
> curious about windows7. But despite being a fan, she is not 100%
> trustful enough of Microsoft and windows7 to give up winXP for it
> immediately.
I am really no friend of Microsoft, but Win 7 is IMO really much better than
XP (I can not say the same about Vista) - I had to work with XP for several
years in my job. I have dual boot on the Eee PC (see below) which I bought
in december and left it intact just to play with it (no , not games, with
play I mean try different things on it) and so far I can say that it feels
snappy and stable.
I guess your wife will like it.

As a die hard linux user I have to say: “Windows 7 - not that bad” :wink:

PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.1 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | Gnome 2.32 | nVidia
ION | 3GB Ram

I bet the above scenario has been played out countless times in households around the world. Those words “It worked before, why doesn’t it work now?” have been heard so many times here! The wife likes XP for some things but has finally accepted openSUSE as an alternative. The only major faux pas was fortunately on my own PC when I wiped out the partition table. These days, if I want to experiment, or change something significant, everything gets cloned first.

Your making clone backups (and having the hardware to support that) is smart.

I’m still scratching my head over the details of what happened.

BEFORE I installed window7, my wife’s PC’s menu.lst looked like this:

# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 2
timeout 8
gfxmenu (hd0,5)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.3 -
    root (hd0,5)
    kernel /boot/vmlinuz- root=/dev/disk/by-id/ata-Hitachi_HDS721050CLA362_JP1570HE32RK8K-part6 resume=/dev/disk/by-id/ata-Hitachi_HDS721050CLA362_JP1570HE32RK8K-part5 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3 -
    root (hd0,5)
    kernel /boot/vmlinuz- root=/dev/disk/by-id/ata-Hitachi_HDS721050CLA362_JP1570HE32RK8K-part6 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-

###Don't change this comment - YaST2 identifier: Original name: other###
**title winXP-IDE**
    rootnoverify (hd**0**,0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: other###
title winXP-SATA
    rootnoverify (hd0,0)
    chainloader +1

where she had winXP (called winXP-IDE) on the IDE drive and she had a non-functional winXP on the SATA drive (called winXP-SATA) and she also had openSUSE on the SATA drive.

Windows7 was placed in the same location as the old WinXP Sata (ie on partition-1 of the SATA drive).

But as noted, I mistakenly over wrote the MBR of the IDE drive on to the MBR of the SATA drive. I assume because the drives had similar partitioning, the Linux actually managed to boot (which mislead me) to the SATA drive. But when ever I selected winXP-IDE or winXP-SATA in Grub, it took me to Windows7 !! Most bizarre, and clearly the MBR was pointing to a different drive !

After many menu.lst hacks (none of which worked), I finally restored the MBR properly !

With the MBR restored, I eventually put in place a menu.lst that worked, but it is NOT the same as the original MBR (but I suspect now the original would have worked with the MBR fixed). I now have this in place for the winXP-IDE in the menu.lst:

title winXP-IDE
    rootnoverify (hd**1**,0)
    chainloader +1

and it boots fine.

That appears to be functionally the same as the old:

title winXP-IDE
    rootnoverify (hd**0**,0)
    chainloader +1

ie by changing the order of the two map(hdx,hdy) entries in the menu.lst I then had to change the rootnoverify hdx … which I don’t understand.

Maybe some day I will.