Fixing Opensolaris Grub09-02-2009
This is more just for my own sake rather than a post for the world and his wife to read so if you have no interest in computer stuff don't read this.
At the weekend I thought I would update my operating system and regretted it more or less straight away. I do have a "If it works the way I want, leave it alone!" policy but I decided to ignore my own rule.
More fool me!
The new operating system has a lot of work to be done to it. Hell it ran slower than it should have and I have a high spec laptop. So after an hour messing with it I gave up and just went back to my previous installed OS. The problem is that it overwrote something called grub.
For those that don't know, grub is what is called a "bootloader". You can have more than one operating system on a computer at any one time, grub is a menu that let's you pick which one to boot up. My laptop had a grub with two entries, my Linux and some Opensolaris (because that is work's operating system and we use it for working from home).
Anyway, the problem was that instead of one grub I had two, grub that loaded linux and an option on it that loaded the grub for Opensolaris.
Solution to fix is actually quite easy. Since I knew my Opensolaris grub worked perfectly and needed that to be the main one I had to install it to the MBR section of the drive.
This gets done by running the following command:
/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/cXdYs0
Boot up Opensolaris and type format (as the superuser) to get the hard drive value. In my case it would be c6d0s0. Then run that line as root, with your hard drive value in place of the XY one, and answer yes to the question. Reboot the system and you should have only the Opensolaris grub menu.
Promise, my next post won't be a techie one. But this might help another tech head in the future.