This e-mail is a perfect illustration of the need for MBRFIX, so here it is for everyone
to see; it's been edited to clarify its use, and the client's identity has been removed.

---------- Original Message ----------
To: TheStarman <killallspam@localhost.net>
From: Concerned Reader <killallspam@localhost.net>
Subject: Netbook woes
Date: Wednesday, 08 July 2009

Hi,

I've recently purchased a second-hand "netbook" preloaded with Win XP (Home) on its 4GB SSD. It works well, but I wanted to try out a small Linux distro (Puppy) on the Secondary 8GB SSD. It installed GRUB and all is working well, but I've decided to return to the original configuration (i.e., booting from WinXP and using the 8GB SSD for data storage only). My concerns: "What changes has GRUB made to the first MBR, and if I delete/format the 8GB SSD will I be able to boot at all?" To make matters worse, I do not have the original Windows install CD, so can't use Windows XP's fixmbr.

I have found and downloaded "MbrFix.exe", but before I use it I would like to know which command to use. Will fixmbr [under MbrFix.exe; if one adds "/Vista" it will use the Vista MBR code instead] be the command to use? At the moment I cannot even access the BIOS setup, because the PC boots immediately into the GRUB menu.

Your assistance is very much appreciated.

[I have no idea why he couldn't access the BIOS, but here's my detailed reply about MbrFix]:

==================================
To: Concerned Reader <killallspam@localhost.net>
From: "The Starman" <killallspam@localhost.net>
Date: Wed, 8 Jul 2009
Subject: Re: Netbook woes

Hi Reader,

I appreciate very much that you thought to ask ahead of time, rather than after trying to fix a system you were unsure of what to do with, and having to look for help later.

I'm assuming you can still boot-up into either of your operating systems, and are most likely using Windows XP right now, correct? Please confirm: Is the MBRFIX.EXE you have from this site:

   http://www.sysint.no/nedlasting/mbrfix.htm

And/or that you Downloaded version 1.0.9; probably from here:

   http://www.sysint.no/Download/tabid/162/Default.aspx

Right? If not, please do so, as this is the PROGRAM I'm commenting on here!

-----------------------------------------------------------------------------
Oh, if you don't have it, I recommend getting a copy of HxD, the free File
and Disk Hex Editor, so you can visually see any changes you make both BEFORE
and AFTER you reboot your computer! NOTE (on changing MBR code and its data):
None of the changes you make to your MBR sector will have any effect while your
OS is still running, only when you reboot; UNLESS there's a power failure,
or you decide to reboot the computer without remembering you were still working
on your MBR or did not make sure you made the right choice(s) when changing it!
BUT until the PC actualy shuts down/reboots, you can make all the changes you
want to.

You can get the latest copy of HxD here:  http://www.mh-nexus.de/hxd/
-----------------------------------------------------------------------------

Run MBRFIX.EXE with the "-h" switch to see all of its commands (it's in a 'Tools' folder on this box):

C:\Tools> mbrfix -h
MbrFix.exe      Copyright (C) 2004-2009 Systemintegrasjon AS
                http://www.sysint.no
Usage:
MbrFix /drive <num> { command } { /yes } { /verbose }

Commands:
MbrFix /?                                  Display help page and license
MbrFix /drive <num> driveinfo              Display drive information
MbrFix /drive <num> drivesize              Returns size in MB as return value
MbrFix /drive <num> listpartitions         Display partition information
MbrFix /drive <num> savembr <file>         Save MBR and partitions to file
MbrFix /drive <num> restorembr <file>      Restore MBR and partitions from file
MbrFix /drive <num> fixmbr {/vista|/win7}  Update MBR to W2K/XP/2003 (default),
                                           Vista or Windows 7
MbrFix /drive <num> clean                  Delete all partitions on drive
MbrFix /drive <num> readsignature {/byte}  Read disk signature from MBR
MbrFix /drive <num> generatesignature      Generate disk signature in MBR
MbrFix /drive <num> writesignature <bytes> Write disk signature in MBR
MbrFix /drive <num> readstate              Read state from byte 0x1b2 in MBR
MbrFix /drive <num> writestate <state>     Write state to byte 0x1b2 in MBR
MbrFix /drive <num> readdrive <startsector> <sectorcount> <file> 
                                           Save sectors from drive to file
MbrFix /drive <num> /partition <part> fixbootsector <os>
                                           Update Boot code in boot sector
MbrFix /drive <num> /partition <part> getpartitiontype
                                           Get partition type
MbrFix /drive <num> /partition <part> setpartitiontype <typenum>
                                           Set partition type
MbrFix /drive <num> /partition <part> setactivepartition
                                           Set active partition
MbrFix /drive <num> getactivepartition     Get active partition
MbrFix volumeinformation driveletter       Get volume information for partition
MbrFix flush {driveletter(s)}              Flush files to disk for partition
MbrFix listpartitiontypes                  List partition types

Now run the info command to be sure whether it's disk "0" or "1" that is the actual hard disk you want to change. E.g., on a nearby Win XP system, I entered the following at a Commnad-Line prompt for the folder containing mbrfix.exe, and got the following:

C:\Tools> MBRFIX /drive 0 driveinfo
Drive 0
Cylinders = 38913
Tracks (heads) per cylinder = 255
Sectors per track = 63
Bytes per sector = 512
Disk size = 320070320640 (Bytes) = 298 (GB)

This is a 320 GB SATA-II hard disk; you can also check your partitions using:

C:\Tools> MBRFIX /drive 0 listpartitions
# Boot Size (MB) Type
1 Yes     29996    7  NTFS or HPFS
2         99998    7  NTFS or HPFS
3        175248   15  WIN95: Extended partition, LBA-mapped
4             0    0  None

Kåre (the author MbrFix) does *not* use the usual Hex values for the partition types, but rather ordinary decimal numbers; so "15" is really the "0F" you might be used to seeing in other partition table utilities (and on the disk). From what you wrote, you should have a single type "7" on each of your disks.

NOW, YOU SHOULD 'BACK UP' THE DATA FROM YOUR EXISTING TABLE BY DOING:

C:\Tools> MBRFIX /drive 0 savembr disk0mbr.bin 

which worked just fine on our test system here. You might as well do it for your other disk too; use "disk1mbr.bin" for it. And I'd add it's a good idea to save at least the first 100 sectors of each disk, so you have a copy of your Volume Boot Record (usually at Sector 63) as well:

C:\Tools> MBRFIX /drive 0 readdrive 0 100 0dsk100s.bin 

And maybe for your other disk too; use 1dsk100s.bin (for disk 1 and 100 sectors). BTW, all the file names above are just suggestions; use any you like better.

OK, NOW YOU CAN CHANGE THE MBR WITHOUT ANY WORRIES IN CASE YOU MAKE A MISTAKE (since you could use the "restorembr" command to make things right again) Proceed as follows:

  
  C:\Tools> MBRFIX /drive 0 fixmbr  [Using the MBR code for Windows 2000/XP/2003.]
  You are about to Fix MBR,
  are you sure (Y/N)? y

Answer 'y' only if you have "backed up" your original data. I just carried out this command on my own computer, compared the before and after MBR sectors digitally (by saving MBR sector again to dskAmbr.bin), and the results were: "No differences found".

So, whatever fixmbr does, it did not change the partition table, and the code is exactly the same as the WinXP (SP2) machine I tested it on.

Therefore, I can state that I have tested this version of the program, and if used exactly as I did here, you should not have any problems.

Oh, and before you ever reboot a PC after making changes to the MBR sector, I'd check to be sure you have your WinXP OS set to "Yes" (Active boot partition) or it still might not boot up.

Cheers, Daniel.
(aka, TheStarman.)

Updated: 09 August 2009 (09-08-2009); many corrections in HTML code -- please delete previous file!!
Hosted by uCoz