2

I reinstalled Windows XP on a friend's computer. It was nuked with viruses and malware, so I booted with a Ubuntu live CD and used GParted to make a new partition (recovery), move all of their files onto the partition, and erase the primary.

After reinstalling Windows XP, I moved their files back onto the C: drive, and went to disk management to remove the parition. However, the D: partition now has a system flag, even though Windows is installed on the C: drive, with the boot flag and settings, and there is NOTHING on D:

How can I safely remove it (Windows won't let from the GUI) without losing access to the XP install, so I can recover the space from growing the C partition?

Here is a picture of the partitions:

Partition Layout In Windows Screenshot


Update: I am informed removing the system partition would ruin the boot loader; can I get an example or walkthrough on how I can reclaim this space? I don't want to be figuring it out "on the fly" when I finally go to fix this problem.

Gareth
  • 19,080
Urda
  • 847

3 Answers3

2

I would suggest using your LiveCD again to remove the partition if it is indeed empty. Then use Windows to recreate it as needed.

Mark Reid
  • 146
0

Have you looked at the boot.ini file (hidden/system file in C:) with an editor? It contains the entries of the Windows boot loader, maybe there's something still pointing there.

Basically, the boot sequence is: Masterboot record (fixed by a fixboot /MBR or similar process) looks for active partition (the LiveCD can mark the 1st partition active, so you can fix that) which loads NTLDR which loads the boot.ini which presents the boot menu (or if there is only one entry boots from that).

If indeed something in that sequence is on the 2nd partition it can be fixed (a XP repair install cures nearly everything that can go wrong).

Nicholaz
  • 1,755
0

How can I safely remove it (Windows won't let from the GUI) without losing access to the XP install, so I can recovery the space by growing the C partition.

If you used a Linux Live-CD to do your work, then you may already know how Linux sees delineates partitions.

If there is one SATA hard drive with two partitions, Linux would show them as follows:

/dev/sda1   which is the first partition, probably C: under Windows
/dev/sda2   which is the second partition, probably D: under Windows

The thing to do would be to completely wipe the virus-ridden partition and then let a partition table editor do its job. I would wipe the hard drive using dd.

I would boot my PLD Rescue CD and key in the command:

dd if=/dev/urandom | pipemeter | dd of=/dev/sda2 && dd if=/dev/zero | pipemeter | dd of=/dev/sda2

This would fill the second partition on the hard drive with random data, and then go back and zero it all out. You don't have to fill the partition with random data, and skipping this step saves time. It's up to your personal preference.

If you just want to zero the second partition, use the following command:

dd if=/dev/zero | pipemeter | dd of=/dev/sda2

And again, just let the partition table editing tool do its own work.

Good luck!

eleven81
  • 16,182