I had a bit of trouble booting into Ubuntu after connecting a new SATA hard disk drive.
After a fair amount of searching, I found a solution at linuxquestions.org. It seems that his system had shifted the disk from hda to hdb. As I’m using a SATA disk, I needed to change the drive from sda to sdb.
If you’re not sure what the drive listings are, boot your system with a boot CD such as Knoppix or the Ubuntu installation CD, open the terminal and type sudo fdisk -l. This will list the partitions on your system. You should see entries like this:
/dev/sdb1 * 1 19080 153260068+ 83 Linux
/dev/sdb2 19081 19457 3028252+ 5 Extended
/dev/sdb5 19081 19457 3028221 82 Linux swap / Solaris
The path after /dev/ is what you are looking for.
Reboot your computer, press the ESC key when Grub is loading (you have 3 seconds by default).
In the menu you will see two entries for booting Ubuntu. Select the entry that you wish to change, and press ‘E‘ to edit the options. Find the line which reads something like:
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb1 ro quiet splash
Edit the root= path to the drive that you spotted in the fdisk readout. Press ‘b’ to boot.
Assuming that the process was a success, you should find yourself logging into Linux. From here, you can edit the boot file and save the changes that you just made.
- Open a terminal
- type sudo gedit /boot/grub/menu.lst
Towards the end of the file, you should find the paths that you changed to be able to log on. If you change them again like you did above, and then save the file, the next time you boot Linux should start with no issues.