How to reinstall the grub boot manager on Ubuntu Linux
My new Compaq CQ20 noteobook has a “recovery button” feature which I really haven’t gotten to checkout. The other day while setting up Ubuntu, I inadvertently pressed on the button which resulted to a “missing operating system” message when I got my notebook restarted. That recovery button should really be moved to a separate location or better yet have a disable feature option. I know that my data is still intact and that maybe the boot sector was the only area on the disk that was affected.
I took my Ubuntu Intrepid installer usb stick and booted it. Once Ubuntu was running, I checked my hard disk’s partition table using the program fdisk. I did the following on a terminal:
$ sudo -s# fdisk /dev/sda
After issuing the “p” command of fdisk, I found that my partition is still intact. This got me to thinking that my hard disk’s grub boot manager was the thing that was actually erased. I ran grub and restored my the boot sector. Here’s how I did it:
While still logged in as root, run grub.
# grub
If you know what the root for grub for your system is then key in the root command for grub. You should have something like the one below after the “grub>” prompt:
grub> root (hd0,1)
If you don’t know where it should be then let grub find it by:
grub> find /boot/grub/stage1
At last, now to install the grub boot manager:
grub> setup (hd0)
That’s it, you should now have your Grub boot manager back in the MBR.
Update: Adrimaxi posted a link below to Super Grub Disk — a menu driven way to restore your grub boot loader. Thanks Adrimaxi.
- How to install apache, mysql, php on ubuntu linux desktop
- How to upgrade to Open Office 3.0 on Ubuntu Linux
- Wikipedia is switching to Ubuntu Linux
- Minimize to tray icon your Thunderbird (and anything) in Ubuntu Linux
- How To: Install Ubuntu Linux on HP Compaq C700 notebook
- Ubuntu Linux gets Adobe Air 1.5 runtime and SDK
- How to install NetBeans 6.5 on Ubuntu Linux desktop edition
- How To: Install Ubuntu Linux on HP Compaq C700 (Part 2)








![QRcode[601] QRcode:601](http://gerry.ws/wp-content/blogs.dir/2/qrcode-cache/601.jpg)














Why didn’t you used the supergrubdisk that does it automaticaly from either your usb thumb or a cd-r…
http://www.supergrubdisk.org/
It’s is so easy to recover your grub (or windows mbr) with no command lines.
Cdy,