Wednesday, May 28, 2008

How to get Solaris with Grub on x86 to boot verbosely

The fact is, great as OpenSolaris is, things do sometimes go wrong, and often booting with verbose output will help you identify why, or at least where in the boot process, things are breaking. How to enable verbose booting is a really simple question, yet one to which I found the answer to be quite elusive for months. I still don't have an official answer, but this is how I managed to do it:

First, find your grub boot menu list file. If you are using ZFS boot, it is in /rpool/boot/grub and if you are using UFS it will be in /boot/grub

Make a backup of the file, then open it up in your favorite editor, and comment out the splash image line near the start.

Now copy the section for your Solaris image. On my system it looks like this:

title LiveUpgradeSNV90_2008-05-27

findroot (BE_LiveUpgradeSNV90_2008-05-27,0,e)

kernel$ /platform/i86pc/kernel/$ISADIR/unix

module$ /platform/i86pc/$ISADIR/boot_archive

You need to change two things: 1) Give it a new title, and 2) Add -v to the kernel line.

Note: -v is in fact a boot-arg, supplied to the unix program. For detailed information have a look at the man page for boot(1m)

After saving your changes, use bootadm to check for mistakes, eg

# bootadm list-menu

The location for the active GRUB menu is: /boot/grub/menu.lst

default 3

timeout 10

0 LiveUpgradeSNV89_2008-05-21

1 LiveUpgradeSNV89_2008-05-21 Solaris xVM

2 LiveUpgradeSNV89_2008-05-21 failsafe

3 LiveUpgradeSNV90_2008-05-27

4 LiveUpgradeSNV90_2008-05-27 Solaris xVM

5 LiveUpgradeSNV90_2008-05-27 failsafe

6 Verbose_Boot_LiveUpgradeSNV90_2008-05-27

Entry nr 6 is the new Entry I added by making a copy of entry nr 3 in the list.

Now all that remains is to test it by rebooting the box. Q.E.D.