A while ago I was asked to look at the boot_archive, It's not much but this is a start. I'll keep going with this as long as I can find something new to add. this is a bit rambling at the moment, but I will get to making it all pretty when I have the chance.
bootadm is used to both update and re-create the boot_archive file, it does this using various scripts and binarys to create a iso image (boot_archive), when grub hands over to the image (you can see the images list in in the menu.lst file) it's used to provide kernel memory modules and configuration files..
bootadm looks specifically for the following files (this list is from my machine), your list might differ slightly (no acpi etc?)
etc/rtc_config
etc/system
etc/name_to_major
etc/driver_aliases
etc/name_to_sysnum
etc/dacf.conf
etc/driver_classes
etc/path_to_inst
etc/mach
etc/devices/devid_cache
etc/devices/retire_store
etc/devices/mdi_scsi_vhci_cache
etc/devices/mdi_ib_cache
etc/cluster/nodeid
kernel
platform/i86pc/biosint
platform/i86pc/kernel
platform/i86xpv/kernel
platform/i86pc/ucode/GenuineIntel
platform/i86pc/ucode/AuthenticAMD
boot/solaris/bootenv.rc
boot/solaris/devicedb/master
boot/acpi/tables
bootadm checks a file called /boot/solaris/filelist.ramdisk you can see this list for yourself by using: bootadm list-archive.
Sometimes, when the machine reboots without you expecting it, it might well not be happy about the boot_archive, it will try to resolve any problems itself, sometimes though it can't. a fairly simple way of of replacing the boot_archive is as follows (providing the disk isn't wrecked of course)
Boot failsafe/cd/dvd (if you can, and your not really going to avoid this that I know of yet).
Mount the root filesystem on /a
cd /a/platform/i86pc
mv boot_archive boot_archive.orig
bootadm update-archive -R /a
Do try to keep the boot archive in case we can look at it and find something useful. The bootadm command might pop a few messages out bleating that it can't find some files, take a look at the list you created using bootadm - list-archive if it's not in the list then don't worry about it and wait to see what happens when you try the boot process. if it is in the list it still might not matter. for instance, on my machine it couldn't find the file "platform/i86pc/ucode/AuthenticAMD" but the machine still came up without issue. the simple message is...don't get too stressed straight away.
You can check /etc/svc/volatile/system-boot-archive:default.log for what it couldn't find, an example from my machine on a normal (none broken) boot is...
---o---
bash-3.2# more /etc/svc/volatile/system-boot-archive:default.log
[ Sep 23 13:18:51 Enabled. ]
[ Sep 23 13:18:52 Executing start method ("/lib/svc/method/boot-archive"). ]
cannot find: /etc/devices/retire_store: No such file or directory
cannot find: /etc/devices/mdi_ib_cache: No such file or directory
cannot find: /etc/cluster/nodeid: No such file or directory
cannot find: /platform/i86pc/biosint: No such file or directory
cannot find: /platform/i86pc/ucode/AuthenticAMD: No such file or directory (<-- my machine is a authentic amd by the way)
[ Sep 23 13:18:53 Method "start" exited with status 0. ]
---o---
If you find a machine panicking (for whatever reason) on boot just as it seems to be starting, it may well be because a file is missing, specifically, if the driver_aliases file is not available or broken then you will get a mount panic. this is because the kernel cannot locate the driver that it needs to understand the underlying storage.
So, what do you do if you lose a file or two (the driver_aliases file for instance)?
boot either failsafe/cd/dvd (whichever you can) once this is done and you have managed to mount the root disk you can use
lofiadm to mount the boot archive (remember when I said it was a iso image?) as so...
lofiadm -a /a/platform/i86pc/boot_archive /dev/lofi/1
mount -F hsfs -o ro /dev/lofi/1 /mnt (the "-F hsfs" option might not work, if not then try the mount without "-F hsfs", it might work)
(as a hint/tip, you can also use this method to mount iso images and img files (filename.iso and filename.img) too)
most of these files are compressed using gzip so will need copying out and the ".gz" extension giving to them. once you have this done you can unzip them (using gzip) and you have the file you were after. once this mounts you can take whatever you need from it, bear in mind though that you might be using severely out of date files, but it might get you by and get the machine of it's knees.
If your archive is broken, see if you have a spare (backup etc), not that it's advocated, but if you ensure you have a copy either of the boot_archive or the files required you should still be ok. Just remember to associate the correct boot_archive with the lofi device for mounting. if you have mirrored disks, make sure you split the mirror before any of this just in case anything you need can be rescued from the mirror.
It's also possible that you may witness other boot failure messages, a common one is the message similar to " reading beyond end of ramdisk", this normally indicates that you have a corrupt boot_archive. check the size of the boot_archive and it's it's less than 20mb (and more likely it will be 20 bytes or so) then consider it corrupt and recreate it. Since your tinkering with the boot-archive, I'll assume your booted from cdrom (not failsafe since this is where this message can be emitted from most of the time), use bootadm update-archive -fR /<boot-archive-mountpoint> to recreate the archive. You may have to delete the boot-archive and create it again, try this before calling in the problem.
BIG NOTE:
---o---
It may be obvious, or not but; you need to know where the boot archive is when updating it. For instance, if you are booted failsafe the root of the disk with the archive your interested in will be /a or wherever you explicitly said to mount it on boot. Remember this, it might save you hours of updating archives and modifying files only to find that none of this worked for you.
---o---
Because I was asked, Here's the (simple) contents of a example bootenv.rc file (note that zfs will not have the bootpath or altbootpath lines) (/boot/solaris/bootenv.rc)
setprop ata-dma-enabled 1
setprop atapi-cd-dma-enabled 1
setprop ttyb-rts-dtr-off false
setprop ttyb-ignore-cd true
setprop ttya-rts-dtr-off false
setprop ttya-ignore-cd true
setprop ttyb-mode 9600,8,n,1,-
setprop ttya-mode 9600,8,n,1,-
setprop lba-access-ok 1
setprop prealloc-chunk-size 0x2000
setprop bootpath /pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@1,0:a
setprop keyboard-layout 'US-English'
setprop console 'ttya'
Because I couldn't remember and had to scratch around for it, here's a reminder of what the contents of an automated menu.lst (/boot/grub/menu.lst)might (don't forget, things change) look like.
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris Express Community Edition snv_107 X86
findroot (rootfs0,0,a)
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris xVM
findroot (rootfs0,0,a)
kernel$ /boot/$ISADIR/xen.gz
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
findroot (rootfs0,0,a)
kernel$ /boot/platform/i86pc/kernel/$ISADIR/unix -s -B console=ttya
module$ /boot/$ISADIR/x86.miniroot-safe
#---------------------END BOOTADM--------------------
Also, don't forget, now you can boot from zfs files such as ...
bootsign
splash.xpm.gz
capability
menu.lst
Reside in /rpool/boot/grub, if you boot zfs and need to make a change to menu.lst either use bootadm (recommended method) or edit this one (not recommended).
This one is for booting from cdrom (it's a standard menu.lst entry when installing from cdrom/dvd).
title Solaris
kernel /boot/multiboot kernel/unix -B install_media=cdrom
module /boot/x86.miniroot
title Solaris Serial Console ttya
kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttya
module /boot/x86.miniroot
title Solaris Serial Console ttyb (for lx50, v60x and v65x)
kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttyb
module /boot/x86.miniroot
---o---
I was asked if I could add something about usb booting: this is what I have so far. It's good for getting a machine up of it's knees but it's not great for the usb device if it's a stick.
ZFS usb boot disk:
Go through your desired build of a zfs based system with at least network support, once done reboot the new build.
When the new build has booted, login and stop volume managent or it get's in the way of writing to the usb device use: svcadm disable -t system/filesystem/volfs
Find the usb device.
rmformat (format -e also shows the device but it might not be so obvious)
create a parttion
fdisk /dev/rdsk/<disk-from-rmformat>
slice the disk using format -e, give everything over to root, no need for lots of slices on a usb emergency boot disk
Once you have completed the above use "zpool attach rpool <original-disk> <usb-disk>". Then, once the resilvering has finished...
Install the master boot record.
fdisk -b /usr/lib/fs/ufs/mboot -n /dev/rdsk/c2t0d0p0
installgrub
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2t0d0s0
You might want to remove the splash screen stuff from /rpool/boot and menu.lst since it's a waste of space and load time. Then go for a trial boot. Since zfs doesn't use bootenv.rc to find it's boot device you should be able to boot this usb device easily. Be aware though that inserting this device could upset the device boot order; Also, since this is an o/s on a stick, you will be able to mount ufs as well as zfs disks. Don't forget the utilities as well, things like ssh, ftp, ipmitool etc are all useful and, if your planning on using this to send us information, they are essential.
---o---