Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Windows XP in dual-boot with Ubuntu to play Skyrim and that ended up breaking GRUB. After trying zillions of things to fix it (including using boot-repair), I installed Ubuntu in a new partition, side-by-side with the old Ubuntu and XP. After that GRUB worked again and I can now access my old Ubuntu and XP, but now I have two Ubuntus and I want to drop the new one. How do I do that without breaking GRUB again?

Here's the result for sudo fdisk -l:

Device      Boot    Start       End     Blocks      Id  System
/dev/sda1   *           1       17303   138986316   83  Linux
/dev/sda2           19799       29359    76798732+   7  HPFS/NTFS
/dev/sda3           29360       30401     8369865   82  Linux swap / Solaris
/dev/sda4           17304       19798    20040705    5  Extended
/dev/sda5           17304       17595     2343936   83  Linux
/dev/sda6           17595       18811     9764864   83  Linux
/dev/sda7           18811       19677     6952960   83  Linux
/dev/sda8           19677       19798      975872   82  Linux swap / Solaris

sda1 and sda3 are my old Ubuntu, sda2 is Windows XP, and sda4 to sda8 are the new Ubuntu install (I created different partitions for /boot, / and /home, should not have done that just to fix GRUB).

And /etc/fstab looks like this:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=e41d0403-82db-4379-9d3e-b67cb06fc08d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=5a54507a-82f0-4275-b531-f88b9cfabbcb none            swap    sw              0       0

And here is the report from Boot-Repair:

http://paste.ubuntu.com/740188/

And here is the list from /dev/disk/by-uuid:

ubuntu@ubuntu:~$ ls -la /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 140 2011-11-16 13:21 .
drwxr-xr-x 6 root root 120 2011-11-16 13:19 ..
lrwxrwxrwx 1 root root  10 2011-11-16 13:19 11F7-4048 -> ../../sdb1
lrwxrwxrwx 1 root root  10 2011-11-16 13:19 40b84b5c-dd62-4267-a41c-e5afc0c178a4 -> ../../sda3
lrwxrwxrwx 1 root root  11 2011-11-16 13:19 82672ddd-82ac-4d41-98c2-fc359f248f3b -> ../../loop1
lrwxrwxrwx 1 root root  10 2011-11-16 13:21 DE34ED7A34ED5655 -> ../../sda2
lrwxrwxrwx 1 root root  10 2011-11-16 13:21 e41d0403-82db-4379-9d3e-b67cb06fc08d -> ../../sda1
share|improve this question
    
Did you install it via Wubi? –  jrg Nov 16 '11 at 12:35
    
No, I just created a new partition, booted from Windows CD and installed it. –  moraes Nov 16 '11 at 12:59
    
I mean, I never used Wubi I think. Ubuntu is my main OS, and I installed it using the distribution from ubuntu.org. Windows came only these days. –  moraes Nov 16 '11 at 13:06
    
can you add the output of ls -la /dev/disk/by-uuid please? You have two swap partitions, which is unusual. –  Michael K Nov 16 '11 at 13:25
    
@MichaelK I updated it with that info. I created a second swap for the second Ubuntu install. But I no longer have it, as I deleted the partitions sda4,sda5,sda6,sda7,sda8 following previous answers. I also added the output from Boot-Repair, got while I am on the live-USB. –  moraes Nov 16 '11 at 13:35

2 Answers 2

up vote 2 down vote accepted

Boot in to Ubuntu installation that you want to keep. Delete the partitions for the other Ubuntu install and run update-grub.
So if you want to keep your old linux installation and get rid of the one you installed later, just boot into your old linux installation and start gparted or disk-utility (which ever you like). From there delete sda4, sda5, sda6, sda7 and sda8 i.e all the partitions you created for new installation of Ubuntu. Now open terminal and run sudo update-grub. This will update the grub and remove the other Ubuntu install from the grub startup screen.

share|improve this answer
    
I did that. Deleted partitions from new Ubuntu using gparted, then ran update-grub. Now I'm on the Live CD because GRUB got borked again. :-( –  moraes Nov 16 '11 at 12:55
    
Really sorry for that. From the output of boot-repair, Grub is looking for /grub in partition no 5 which no longer exists. You will need to reinstall grub. Plz use the steps mentioned here ubuntuforums.org/showthread.php?t=1195275 to reinstall grub. I personally used these steps to repair a broken grub installation and I am confident it will solve your problem. –  binW Nov 16 '11 at 14:35
    
the above link is for grub2 and the step 13 i.e "Reinstalling GRUB 2 from LiveCD" is the one you need to follow. In case you a version of Ubuntu with Grub (not Grub2) then you can use the steps mentioned at ubuntuforums.org/showthread.php?t=224351 to reinstall grub –  binW Nov 16 '11 at 14:39
    
Thank you, sir. And to everybody who helped. I'm back to my old Ubuntu and the new one is finally gone. :) –  moraes Nov 16 '11 at 15:17

You can perform the following steps:

  1. comment out the lines for sda1 and sda3 in your /etc/fstab. this prevents them from being mounted.

  2. reformat (and maybe even repartition) the two partitions. However, merging them will most likely only work, if they are stored physically behind each other on the disk.

  3. invoke update-grub to make grub refresh its menu.

But be careful, your computer seems to boot from sda1. Depending on how you installed the second ubuntu, you might have to mark the new root / boot partition as bootable.

share|improve this answer
    
sda1 and sda3are the ones I want to keep, so I'll take that you mean sda4 to sda8. These latter ones are all close to each other in the disk, and I can merge to sda1 in the end (the space was taken from sda1 for the new Ubuntu install). –  moraes Nov 16 '11 at 12:13
    
I updated the question with the contents of /etc/fstab. I'm not sure if I have anything to comment out from there. When I run update-grub, it finds the new Ubuntu on /dev/sda6. I need to discover how to make GRUB ignore that one. –  moraes Nov 16 '11 at 12:24
    
ah okay... well the change in fstab is only necessary to prevent your new linux from trying to mount a partition which you later delete. This is not the case for you. So now you can remove (delete) the partitions of the linux installation you want to remove and invoke update-grub. (update-grub will detect both linux versions as long as both are present) However, if you were to delete sda1 you would run into trouble. –  Michael K Nov 16 '11 at 12:34
    
For some reason that did not work. I deleted the partitions, ran update-grub and restarted. GRUB is borked again and I am on the Live CD. –  moraes Nov 16 '11 at 13:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.