I read in Softpedia’s Linux section that Ubuntu 8.04 LTS (Hardy Heron) was coming to its end of life and would not be supported after 12-May-11. And, after replacing Hardy with Ubuntu 10.04 LTS, I haven’t found it necessary to go back to the old distro. So, I thought, perhaps now is a good time to wipe the 8.04 partition from my hard disk, and go back to the simpler times of a dual-boot system (Ubuntu 10.04 and Vista).
But, past experience told me that mucking about with disk partitions would render the machine unbootable, so first I needed to dig out my copy of the Super GRUB 1.21 Disk. Now, unlike the old Super GRUB disk (based on GRUB legacy), the new version for GRUB2 can’t repair the boot system, but it will allow booting into a system that is broken. And, I just know something is going to break!
Initially, things went reasonably well. I used my Ubuntu 10.04 installation disk to boot into the live-CD, and ran GParted (System – Administration – GParted) in order to delete the Ubuntu 8.04 disk partition.
I found one trick was necessary to make the deletion work. Initially, I just tried to delete /dev/sda5, where Ubuntu 8.04 was installed, but received a message indicating that I should “Unmount any logical partitions having a number higher than 5”. The non-intuitive solution to this problem is to right click on /dev/sda6, the swap drive associated with Ubuntu 8.04, and select Swapoff. Initially, there is an icon of a key displayed next to the swap partition. Toggling Swapoff removes this icon showing that the swap partition is now unmounted. In my case, I also had to do the same thing to /dev/sda8, the swap partition for Ubuntu 10.04, in order to have all the partitions higher than 5 unmounted.
Now, I was able to highlight /dev/sda5 and /dev/sda6 and mark both for deletion. This had the effect of re-numbering sda7 and sda8, the two partitions used for Ubuntu 10.04 and its swap disk, to sda5 and sda6. Reasonable, given that the old sda5 and sda6 are going to be deleted, but it almost certainly means trouble later on when trying to reboot. Anyway, now is not the time for the faint of heart. Hit the Apply button and make the old partitions go away!
Now, the acid test. Reboot the machine and, sure enough, instead of a boot menu, we get “error: no such partition”!
Remember, that Super GRUB disk? Booting from this CD gives a menu item to boot the “First Kernel and Initrd” which does indeed boot into the Ubuntu 10.04 system on the hard drive. So far, so good. But, how do we fix the boot system?
I thought that the problem was that grub.cfg was still listing the bootable partition as (hdo,7). Remember that, originally, Ubuntu 10.04 was located on /dev/sda7 which translates into a set root='(hd0,7)’ command. But, since the partition has effectively been moved to /dev/sda5, we need the boot entry to read set root='(hd0,5)’. Running sudo update-grub has the desired effect, but rebooting once again brings up the dreaded “error: no such partition” message!
So, what’s going on now? It seems as though grub.cfg is now configured correctly, but the boot loader isn’t producing the boot menu.
The fix for this is to reinstall GRUB2 and refresh the Master Boot Record (MBR) on the hard drive. The detailed instructions can be found in the Ubuntu Community Documentation on Grub2.
So, it’s back to the Ubuntu 10.04 installation disk, and the following steps:
1. Mount the Ubuntu 10.04 partition using sudo mount /dev/sda5 /mnt
2. Run the grub-install command: sudo grub-install –root-directory=/mnt /dev/sda
4. Run sudo update-grub
This time, a system reboot brings up the very welcome boot menu with both Ubuntu 10.04 and Vista available for access. There is also an entry for Ubuntu 8.04 (which no longer works) but this can easily be removed by editing the /etc/grub.d/40_custom file and re-running sudo update-grub (see GRUB2 revisited).
Goodbye Ubuntu 8.04 LTS
Super GRUB Disk
Ubuntu Community Documentation Grub2