Saving Private Grub

November 14, 2010

Still remember the first time I lost grub due to windows 7 rape, I reinstalled ubuntu without a second thought. This is not happening again. This time I realize it’s only grub removed but the entire linux system is still kept. After all these sorrowful reinstallation, I decided I’ll rescue private grub no matter what.

The first official ubuntu documentation addressing this problem got me a flashing cursor instead of a grub menu. The Chinese blog (courtesy of myrice)led me to a shell mode (should’ve learnt to operate that way as I’ve encountered such situation for too many times.) The real problem for me is that I didn’t even bother to understand the meaning of the new command I was typing.

grub-install –root-directory=<dir> /dev/sda

grub-install copies GRUB images into the DIR/boot directory specified by –root-directory” as pointed out by Jesse. While I just mounted my /boot partition, ignoring the root directory. That explains alot why grub constantly failed. It was never installed to mbr but to /boot. So this is what I see: /boot/boot/grub… what a mess!

Although understanding this didn’t immediately led me to success. But afterwards with help from grub 2 bootloader full tutorial, I was able to fix it all.

It actually took me one hour and a half to settle gizmo down. Better than I reconfigure every tiny little thing tho! After a little elation, I’ve got to say I need to learn from this lesson. Solving problem is not about copying commands and forgetting it. It’s impossible to solve it unless I know the exact effect every command should take.

Still some problems remained.

1. Previously grub was installed in /dev/sda6. But now I choose /dev/sda. Don’t know what this mean to the boot process.

2.chroot and then dpkg-reconfigure grub-pc look fantastic… Even though I somehow saved private grub by doing this, there were errors reported and don’t know why this dpkg thingy worked while grub-install didn’t. The last article I referred to gives a clue that I might find the answer on the official grub wiki guide. Should go and have a look later!

So it’s pretty funny that I start to write like I run a technical blog. But it is not! It’s my nano-correction…

November 14, 2010 @ 3:35 pm

I am sorry that I give you a webpage without any explanation.
It seems that you parted /boot from /
I think first is mounting / to /mnt/root and /boot to /mnt/root/boot
And then grub-install –root-directory /mnt/root

    November 15, 2010 @ 3:55 am

    I did it exactly after I realized I needed to mount root. But it was a flashing cursor. This is the question 2.
    The theme of this blog is about being self-critical, not audience-oriented 🙂

November 14, 2010 @ 3:43 pm

A question: what theme should nano-correction be? 🙂

November 14, 2010 @ 10:01 pm


November 17, 2010 @ 11:56 pm

why u didn’t created a “about” page? btw, wordpress default comments system is more friendly than disqus. I will try to read your politics series, to improve my english…

    November 18, 2010 @ 1:33 am

    wasn’t able to make it the way i want it to be. wanted to link a blog post directly to “About” without creating another “about page”. maybe later.
    it’s simply “fashion” to use disqus 😛 is it not friendly?


Leave a Reply

Your email address will not be published. Required fields are marked *