[ltp] how to restore original MBR and partition table

André Wyrwa linux-thinkpad@linux-thinkpad.org
Fri, 11 May 2007 18:37:48 +1000


--=-zCTrZ/KLCwjyfJm5FlX/
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hei,

> Using an XP cd-rom that I got for my tower, I tried to use the restore
> function "fixboot" and "fixmbr" but I got error that it couldn't find the
> c:\ drive.

That's odd...
can you use a partition editor to check your partition table? I.e. fdisk
or gparted if you want to go graphical.

Afaik, windows does not store the drive letter in the partition table
nor in the boot sectors. I think what this error is about would rather
be that your windows partition is not recognized as fat or ntfs
partition anymore. Please check what fdisk sais it's type is. And also
check if it has the active (bootable) flag set.

Also, what was the dd command you used?

> Now all I can use is linux, no great loss because I use mostly linux
> but I still want to use XP  for some programs that are not available
> for linux.

Use wine. ;-)

> The main question is can you restore the original partition table
> and MBR without re-installing XP from the rescue and restore
> function on the Thinkpad?

You could try pc-doctor, which you will find on your rescue&recovery
system, but i don't know if it would really help nor if you can really
trust it. It is, however, what IBM/Lenovo gave you to rescue a damaged
windows system.

> All the files and programs in XP are still on the computer,
> although the rescue cd can't find the c:\ drive.

Are you sure? can you mount the XP partition and see them? Are the ntldr
and boot.ini files present as well?

Windows (NTFS?) stores a copy of the partition boot sector at the end of
the partition. There are rescue tools that can recover it from there.
Maybe PC-Doctor can as well. This might enable you to use fixboot and
fixmbr afterwards. But i'm not sure.

Also, you don't need the original MBR to boot your XP. All you need is a
proper ntldr boot sector and you can chainload that from grub. If it is
an NTFS volume, as i'm assuming, another possibility would be to copy
the partitions boot sector from another Windows installation. Afaik the
boot sector is rather primitive and just looks for the ntldr file on the
NTFS partition that carries the active flag. So it is installation
independent and you can copy it via dd to a file and then from there to
the partition. Only thing you need is another windows installation and
Linux access to it. ;-)

I'm not 100 percent sure about any of all this, but it's what's left in
my mind from the adventures that i had. (And I can assure you that i
recently successfully copied a nt boot sector from one harddisk to the
other.)

Andr=C3=A9.


--=-zCTrZ/KLCwjyfJm5FlX/
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBGRCtbEOp8fsnyxsQRAjmaAJ4v2CZoG143GJeyCPFVb7ZZFtsnlACfQ6DC
u6daMWFSvamt8GmA9x2CeBY=
=FmHt
-----END PGP SIGNATURE-----

--=-zCTrZ/KLCwjyfJm5FlX/--