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…