Need to uninstall corrupted Linux on multi-boot system

Asked by Chris Johnson

I started out with a Win XP only laptop. I installed Ubuntu 10.04 as dual boot and botched the installation but was left with an unusable linux partition in addition to still-working XP and the appropriate GRUB entries.

Unable to recover that installation, I installed a new instance of Ubuntu in another partition. That one works fine, as does the original XP. But now I have an unusable Ubuntu partition and OS wasting space. How can I safely remove the old Ubuntu partition from the hard drive and GRUB?

I considered just using the disk utility in System Administration but don't want to do that lest I break the currently-working systems. I am not a total newbie but would appreciate fairly detailed instructions as I am very leery of another disaster at this point (I don't have time to keep starting over).

TNX

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Solved by:
marcus aurelius
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
delance (olivier-delance) said :
#1

Using disk utility in System Administration is the good way, but not from working Ubuntu.
At boot, identify on which partition is failing Ubuntu.

Boot on Ubuntu CD and choose "Try" instead of "Install".
Then System->Administration->disk utility
Delete ext4 partition of failing Ubuntu.
If you see two swap partition, remove one of them.
Extend ext4 partition of working Ubuntu to use freed space.
Then reboot on disk.

Revision history for this message
Chris (fabricator4) said :
#2

If you re-installed grub2 with the new linux installation then you can just delete the partition with the broken install and resize existing partions to use the space.

If grub2 was _not_ re-installed with the second Linux install then it's possible that the grub2 configuration files are still on the first Linux partition. I suspect this is not the case however - default behaviour is to install a new grub each time, so the active config files are found on the latest partition.

Note that there is nothing completely safe about re-sizing partitions. It's highly advisable to backup data on affected partitions before starting the operation. A failure during the resize can result in lost data or even (in the worst case) a partition that cannot be accessed. A power outage or a hardware problem can land you in a world of hurt.

To resize the partitions boot off the LiveCD you used for installation (select "try Ubuntu") and then use Gparted to delete and resize partitions.

Disk Utility is OK for basic stuff and looking at SMART data on a disk, but Gparted has more features relating to partition management and is easier to use. One thing that you will need to be aware of is the difference between primary, secondary, and extended partitions. It's quite likely that the Linux partitions are secondary partitions inside an extended partition because that is also the default behaviour of the installer. It will be easy to resize the linux partition to use up the rest of the extended partitions.

If the partitions are set up correctly _before_ installation (or if you're only creating new partitions) then the installation process only takes about 15-20 minutes. It's resizing partitions and moving things around that takes up so much time.

Chris

Revision history for this message
Chris Johnson (cjohnson-propinquity) said :
#3

Thanks Chris, that solved my question.

Revision history for this message
Chris Johnson (cjohnson-propinquity) said :
#4

But on reboot after removing the partition, the system failed on reboot:
Error: No such partition. GRUB Rescue>

A Web search found a way to restore GRUB on the page: http://www.rajeshrana.net/2010/10/12/grub-error-no-such-partition-grub-rescue/

So everything works now -- however, the deleted Linux partition still shows on the GRUB menu. Not a big deal as I can ignore it, but if there is an easy way to clean up the menu I'd like to hear about it.

Thanks

Revision history for this message
Best marcus aurelius (adbiz) said :
#5

go into terminal and run

sudo update-grub

this should get rid of it. if not, you can go into grub.cfg and remove the entry yourself.

Revision history for this message
Chris Johnson (cjohnson-propinquity) said :
#6

Thanks marcus aurelius, that solved my question.