2

Laptop shut down due to errant battery. I was updating all programs on auto update option. Now all I have is a Grub> prompt. Where do I go from here.

Laptop is an NEC Versa and Ubuntu was working fine up until that moment without any issues.

CJK
  • 21
  • 3
    Hi CJK. You can boot into Ubuntu from a grub> prompt but it can be a little complicated, especially if you don't remember what your partition table looks like. If you have access to a liveCD you can use the method in this Q&A and it should fix the GRUB for you. If you don't have a liveCD or have problems please post as much and we will find another way. – adempewolff Jun 05 '12 at 12:45
  • 2
    Can you perhaps elaborate on what error it's giving you? Certain errors mean certain things. – Thomas Ward Jun 05 '12 at 13:07
  • @adempewolff Yup, I have needed to do that. Having a printed copy of your partition table ready in a waterproof chest really helps. – nanofarad Jun 05 '12 at 17:59

1 Answers1

5

If it is a grub rescue prompt, it is likely that grub cant find what is supposed to be booting. If it is just a generic grub prompt then it is likely something in boot files is messed up.

If you have a boot-cd that takes you into linux, I would suggest booting using that. mounting the drive under /mnt/my_drive, and running a chroot enviroment. the outline basics are bellow...

These commands require you to run them as a root/superuser, the prefered way to do this is prefix the commands with sudo , (alternatively you can use a root shell, created through running sudo -s). Which ever option you choose, beware, you can cause a lot of damage to your system using root, so use it with caution and sparingly.

sudo mkdir /mnt/my_drive

assuming your main partition is sda2

sudo mount /dev/sda2 /mnt/my_drve

then bind the /dev /proc /sys over to your hard drive

sudo mount --bind /dev /mnt/my_drive/dev
sudo mount --bind /proc /mnt/my_drive/proc

sudo mount --bind /sys /mnt/my_drive/sys

then move into a chroot environment

sudo chroot /mnt/my_drive /bin/bash

check that any package installations are configured

sudo dpkg-reconfigure -a

finally run the grub-install to repair the drive in question, often /dev/sda

sudo grub-install /dev/sda

and finally

sudo update-grub