Re: How to erase XP in a dual-boot setup w/Ubuntu
You'll need to make sure you have a good backup of all your files first.
Whenever I'm doing work like that with partitions I usually use GParted and the dd command.
I would use GParted from the Ubuntu Live CD or from Parted Magic Live CD for deleting the Windows XP partition.
If Windows XP was the largest, and taking up more than half of the hard drive it would then be simple to us a dd command to copy Ubuntu to a new partition at the start of the hard disk.
Code:
dd if=/dev/sda2 of=/dev/sda1 bs=4096 conv=notrunc,noerror
Where: You want to copy partition 2 to partition 1
Where: Partition /dev/sda1 is the partition you want to copy Ubuntu to, (your old Windows partition),
and where: Ubuntu is in /dev/sda2.
CAUTION: BE very careful with the dd command, it is powerful and can do a lot of good if you're careful but it can also do a lot of damage if you're not careful with it.
You can use the copy and paste function in GParted if you want to be more careful.
The next step would be to delete the old copy of Ubuntu. (Using GParted).
Just to be safe, after the old Ubuntu has been deleted I'd try booting the new copy of Ubuntu before going any further, to make sure it still works.
If it doesn't, it should still be easy to recover the old copy which has been deleted by using TestDisk.
After the new copy of Ubuntu is tested and proves okay, it will be alright to boot a Live CD again and resize the new Ubuntu to fill the entire disk.
From then on there is a likelyhood that the old installation will begin to be overwritten by new files, so soon your old Ubuntu installation won't be recoverable anymore, not even with TestDisk.
That plan won't work if your Ubuntu partition is larger than your Windows.
You can copy a partition to an equal or larger partition but not to a smaller partition.
If that's the case you'll need to shrink your Ubuntu partition first. You may decide to remove some files, that's up to you. It might make things easier.
Or copy it to some other disk such as an empty USB external hard drive, (with dd), and then copy it back again, but to the start of the hard drive.
Last edited by Herman; December 28th, 2009 at 02:53 AM.
Ubuntu user since 2004 (Warty Warthog)
Bookmarks