Wednesday, 19 May 2010

Ubuntu - Grub - Restoring the grub config.

Trying to make Ubuntu 10.04 boot into command line instead of the display manager, the grub config got messed up. As a result ubuntu would boot but I could not see the display.

Followed the steps to make it work.

1. Boot from the Live CD. Click "Try Ubuntu". Dont "Install".
2. After Ubuntu boots up. Open the terminal.
3. Ubuntu Live CD has a OS of its own. So we see the usual directory list at / directory.
4. Mount the OS directory on the hard drive which is installed on the computer.
To get the list of the partitions.
$sudo fdisk -lu

5. Create the directory to mount.
$sudo mkdir /mnt/harddriveOS

6. Mount the OS. sda5 in the command below might be different according the no of OS'es and partitions on the computer.

$sudo mount /dev/sda5 /mnt/harddriveOS

7. Edit the grub config file.
$gksu gedit /mnt/harddriveOS/boot/grub/grub.cfg

8. Also backed up the working copy of grub.cfg for future reference and checkpoint so that experiments don't end up in a non-bootable,non-accessible junk on hard drive.

No comments: