Grub installer has been deleted in ubuntu

0

1

I was installing an operating system (Fedora) in Virtual box which was installed in the Ubuntu Natty Narhwal. it asked me to format the disk (which should format inside virtual machine), which I did when I restarted my laptop I went to a shell saying...

GNU GRUB VERSION 1.99-21ubuntu3.1 Minimal BASH- like line editing supported. for the first word, TAB lists all possible command completions. Anywhere else TAB list possible device or file completions.

GRUB>

Is there any chance that I can get my operating system back?? I have all the application installed in that which I dont want to install again.

pranav nandedkar

Posted 2012-11-01T22:45:13.043

Reputation: 1

Answers

1

You need to know 2 things, which partition has your /boot files, and which partition is your root folder. If you can figure those 2 things out, then it's fairly straightforward:

If you know where your /boot partition is, you can use tab completion to find a kernel and ram image. Grub's root directory is /boot, so you have to tell it where to find that folder. Grub also has it's own harddrive numbering scheme, so you might have to play around with it, but for me this works:

root (hd0,0)

This sets the Grub root directory to harddisc 0 partition 0. On my system this is /boot so I can use tab completion to find a kernel:

kernel /(press tab)

On my system:

kernel /vmlinuz-2.6.32-279.11.1.el6.x86_64 root=/dev/sda2

Note you have to tell the kernel where to find your root partition for boot up. (This is the root location requirement I mentioned upfront.)

Next you set the initrd image:

initrd /initramfs-2.6.32.279.11.1.el6.x86_64.img

Then you enter

boot

One you've booted up your system, you can repair your grub menu from inside ubuntu using:

sudo update-grub

Niall Byrne

Posted 2012-11-01T22:45:13.043

Reputation: 121

Thanx Niall,
I typed 'ls' command and I got (hd0)(hd0,msdos5)(hd0,msdos1) as output. I guess my ubuntu is installed in hd0,msdos1 which has boot directory but could not find the vmlinuz file in that. can you please help me how to find the vmlinuz file. Also my ubuntu is installed from windows executable file (WUBI.exe) ie I have Windows7 and ubuntu two Os's in my laptop.
– pranav nandedkar – 2012-11-01T23:18:09.717

0

The first thing I would try, if possible, is to:

  • Insert a LiveCD into your CD-drive (the LiveCD should be Ubuntu or some Ubuntu/Debian derivative).

  • Boot up the computer and open up some kind of interactive terminal.

  • Once you are in the terminal, run sudo update-grub. This should re-install GRUB onto your hard drive.

Good luck, I hope this works.

mjgpy3

Posted 2012-11-01T22:45:13.043

Reputation: 101