Ubuntu – Installed ubuntu on external hardrive, tried to boot got grub rescue

bootdual-bootgrub2grubrescueinstallation

I installed Ubuntu 12.10 onto an external hard drive after I partitioned it and everything went well. Assuming I could boot Ubuntu I rebooted the computer and I went into Windows 7, I wanted to be in Ubuntu so I rebooted. I received the no such device grub rescue error when I booted.

I tried boot option, the external hard drive was not option so now I'm stuck using the Ubuntu disk. I tried with GRUB rescue through terminal but Ubuntu was located at /dev/sdd5 366683648 699115007 1329725440 83 Linux which was not recognized

so i tried the GRUB rescue windows by entering sudo mount /dev/sda1 /mnt and I received this:

mount: special device /dev/sda1 does not exist

even though when I entered fdisk -l the report said:

Device Boot  Start   End    Blocks   Id    System
 /dev/sda1    63    80324   40131    de  Dell Utility

I tried super grub disk 2, it found Windows 7 but could not recover without reverting to previous save. It suggested that I unplug all external devices and retry. After I unplugged all devices super grub disk 2 could not find the OS. I ran sudo fdisk -l and received the same list as before.

There is also another problem and I believe they are related when i enter ls into the grub rescue command prompt I get (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) not the normal (hd0) (hd0,Y) (hd0,W) etc.

I tried ls (hd0) /boot the message I received was no such file system.

UPDATE: I tried ubfan1's suggestion but I can't seem to mount it

sudo mount /dev/sde5 /mnt && sudo mount --bind /dev /mnt/dev && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys  && sudo mount --bind /dev/pts /mnt/dev/pts && sudo cp /etc/resolv.conf /mnt/etc/resolv.conf && sudo chroot /mnt  

I recieved the error message:

chroot: cannot change root directory to /mn: No such file or directory  

Is the error my code or something else?

Best Answer

If you installed from a USB live media, you are probably experiencing bug 384633, where the initial creation of the grub boot config file uses a wrong device instead of a UUID. If you can boot off the live media, you can reinstall grub to the external usb disk, and that should fix the grub config file. You can also edit the grub boot commands (commands on screen to edit and boot) to fix the wrong devices. For the last few years, the fix was to simply reduce the disk letter or number by one, and upon successful boot, immediately run

 sudo update-grub

With 12.10, the wrong device has changed, it may even be sda (which is usualy the internal hard disk). In 12.10, I have started seeing the disk lettering change, with the internal hard disk sometimes sdb instead of sda -- not even consistent. But after the update-grub, UUIDs will be used, and the disk letter will no longer matter. Feel free to add yourself to the bug, and maybe someday it will be fixed.

Related Question