Topic: If ubuntu overwrites your mbr (Grub 2)
A minor annoyance with a simple fix - I'm posting it in case it saves someone from having to use something more powerful and dangerous like a live disk.
I've got Ubuntu on a different partition from Statler, and an update the other day from Karmic to Lucid ended with the Ubuntu version of the Grub2 menu written onto my Master Boot Record. It's no big deal - the Crunchbang entry is still there, but it's no longer the default choice and the Statler "powered by Debian" splash image is missing. Googling around brought up lots of solutions involving booting from a live disk and reinstalling Grub, but Ubuntu had rewritten the mbr from a normal session and Statler's Grub was in perfect working order so I figured Crunchbang ought to be able to reclaim the mbr in the same way. Finally found it.
First run
sudo fdisk -lto make sure of the name of the drive the mbr should be on. For a lot of people it will be /dev/sda but check anyway.
Now do this:
sudo grub-setup /dev/xxxwhere xxx is replaced with your drive. That will rewrite your mbr. Don't add a partition number like /dev/sda1, you want the whole drive.
That's it. It ought to work if you've had your mbr overwritten by some other distro while hopping, as long as you can still boot into Crunchbang and as long as there's nothing wrong with your Crunchbang Grub setup. Don't try to fix a broken Grub this way!
------------------------
( a boring Japan blog , and idle twitterings )
“There is more Unix-nature in one line of shell script than there is in ten thousand lines of C.” - Master Foo