Fixing Solaris hosts that boot to a grub> prompt

I applied the latest recommended patch bundle this week to two X4140 servers running Solaris 10. When I rebooted, I was greeted with a grub> prompt instead of the grub menu:


This wasn’t so good, and for some reason the stage1 / stage2 loaders weren’t installed correctly (or the zpool upgrade caused some issues). To fix this issue, I booted to single user mode by inserting a Solaris 10 update 8 CD and adding “console=ttya -s” to the end of the boot line. Once my box booted, I ran ‘zpool status’ to verify my pool was available:

$ zpool status

  pool: rpool
 state: ONLINE
 scrub: none requested

        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c1t0d0s0  ONLINE       0     0     0

errors: No known data errors

To re-install the grub stage1 and stage2 loaders, I ran installgrub (you can get the device to use from ‘zpool status’):

$ /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t0d0s0

stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 272 sectors starting at 50 (abs 16115)

To ensure that the boot archive was up to date, I ran ‘bootadm update-archive’:

$ bootadm update-archive -f -R /a

Creating boot_archive for /a
updating /a/platform/i86pc/boot_archive

Once these changes were made, I init 6’ed the system and it booted successfully. I’ve created quite a grub cheat sheet over the years (this made recovery a snap), and will post it here once I get it cleaned up.

9 thoughts on “Fixing Solaris hosts that boot to a grub> prompt”

  1. Thanks for the post. My company is moving away from Sparc onto x86 and help with the grub menu would be great. I have been having issues with getting a fully automated x86 jumpstart going and ran into an issue with the console output going to the VGA(monitor port) port and not the putty window. I have read that modifying the grub menu will let me redirect the output back to the shell.


  2. We’ve had similar issues, and it’s something you have to watch out for with x86 and zfs root. If you upgrade zfs or zpool versions, and the grub you have installed doesn’t understand the new version, it won’t boot.

    You should also make sure if you are upgrade zfs or zpools, that you have a version of the OS around on CD/DVD (or jumpstart), that understands the new version, or you won’t be able to boot to repair it.

  3. Hey Brian,

    You are spot on. I learned this the hard way, but fortunately I had my cheat sheet to get me back up and running in no time. It would be awesome if ‘zpool upgrade’ would invoke installgrub if the stage1/stage2 loaders need updating. That would rock!

    – Ryan

  4. Hey Alex,

    I’m planning to release my notes sometime over the holidays. There is a bunch of stuff I need to clean up and re-test, which will take a bit of time (I scribble down tons of notes in the middle of the night, and I need to make sure the stuff I release works without issue).

    – Ryan

  5. Hi Ryan

    One of my servers is a HP DL 380 G5 that has a Smart Array Controller, the driver was installed when installing Solaris (add drivers on installation menu). The server has been working for a long time but after installing Virtual Box and rebooting all I get is a grub prompt.

    I have followed your instructions using a Solaris 10 DVD, adding the Smart Array drivers but I still get the grub prompt.

    Do you know if in order to fix grub I have to do something with the Smart Array driver?

    Thanks in advanced!

  6. hello, my zpool status shows
    rpool ONLINE 0 0 0
    c1t1d0p0 ONLINE 0 0 0

    when i do
    /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0

    it shows
    raw device must be a root slice (not s2)

    when i change my device to c1t1d0s0 it says:
    Partition 0 of the disk has an incorrect offset

    what should i do?

Leave a Reply

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