Barny wrote:
> Im sure your all fed up hearing this, but. I installed Ubuntu side by side
> with my current XP. It automatically partitioned my hard drive to accommodate
> it. I then decided I don't like it but Im unable to uninstall it. No matter
> where I look no ones instructions seem to work!
> Booting up is also tricky now as there is something at startup called 'grub'
> which defaults to Ubuntu unless you catch it in time to select XP.
>
> Can anyone please help. I want to remove startup Grub, Ubuntu o/s, and
> reclaim back all my harddrive by removing the partition.
It says to try "fixmbr" from the recovery console, here. The implication
is that the first sector on the disk, sector 0, has had the code section
replaced, to point to the rest of the grub boot loader. The WinXP
recovery console has a command, to put the WinXP version of that code
back in place.
http://tr.opensuse.org/SDB:Uninstalling_the_Boot_Manager_GRUB_from_the_MBR
As always, if you do a backup of the entire disk, if this advice doesn't work
out, you can always put everything back the way it was. For example, you can
use your Linux LiveCD, and the "dd" command, to copy one disk to another for
backup purposes. And using such a sector by sector backup method, means it
doesn't matter what file systems are in use, they'll all get properly
backed up.
The MBR is a single sector, jam packed with goodies. They mention here, for
added fun and complexity, that the primary partition table entries (four 16
byte records, out of the total 512 bytes), can be moved to some other sector,
so some boot loaders can be so damaging as to hide the proper partition table
entries. Which to me, is a scary, single direction approach to modifying the
MBR. If that were the case here, you'd want to find out where the 4 * 16 bytes
of your partition table went.
http://en.wikipedia.org/wiki/Master_boot_record
Major parts (simplified view)
Code area (how Windows starts to boot) 446 bytes
Partition table 4 * 16 bytes 64 bytes
Signature AA55, proof of ownership 2 bytes
Total 512 bytes
A tool like FIXMBR in WinXP Recovery Console, would overwrite the 446 byte part,
and should keep the other 66 bytes. Plus or minus.
While you're in Linux, you can make a copy of the MBR, for safe keeping.
Of course, if you backed up the entire disk, you'd also get a copy that
way. To back up the MBR would look like
dd if=/dev/hda of=my_mbr.dd bs=512 count=1
What that would do, in either Windows or Linux, would be to write a file
called "my_mbr.dd" in the current working directory. You have to figure
out the name of the disk, such as /dev/hda, as well. It isn't a given that
is the name. If you didn't like the results of your FIXMBR attempt, then
putting the MBR back, should repair it.
dd if=my_mbr.dd of=/dev/hda bs=512 count=1
The purpose of using block_size and count in the second instance, is
as insurance to guarantee that no more than sector 0 is affected. The
first command, uses block_size and count, to limit the amount of stuff
captured, to just one sector.
Doing the following, can back up a whole disk to another disk. Sure, there
are other details to worry about (like having enough room to do the command),
but this is the basic idea.
dd if=/dev/hda of=/dev/hdb
That basically makes a "clone" of hda to hdb. I've made backups a few
times like that, when doing surgery where I didn't know what I was doing
As long as you have your "clone" backup disk, and a Linux LiveCD, you can
reverse that and put it all back.
Safety first and have fun,
Paul