Sunday Aug 17, 2008

Playing with kernel can be tricky. Little mistake and one can land up with system that won't even boot! If you are fiddling with a kernel module, it is best to have backed up its working version on the same machine somewhere else. I hadn't and I ran into following on reboot:

Use is subject to license terms.
DEBUG enabled

WARNING: The following files in / differ from the boot archive:

changed /kernel/drv/amd64/vnic
changed /kernel/drv/vnic

The recommended action is to reboot to the failsafe archive to correct
the above inconsistency. To accomplish this, on a GRUB-based platform,
reboot and select the "Solaris failsafe" option from the boot menu.
On an OBP-based platform, reboot then type "boot -F failsafe". Then
follow the prompts to update the boot archive. Alternately, to continue
booting at your own risk, you may clear the servic/ke by running:
"svcadm clear system/boot-archive"

Aug 14 16:42:01 svc.startd[100004]: svc:/system/boot-archive:default: Method "/lib/svc/method/boot-archive" failed with exit status 95.
Aug 14 16:42:01 svc.startd[100004]: system/boot-archive:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Root password for system maintenance (control-d to bypass)

If I had stored working copy of module, then I could have simply booted into Failsafe mode and overwritten the troublesome copy with backup and rebooted. However, I hadn't. The problem:

* Failsafe mode allowed mounting the disk in read/write mode but the machine was not on network.

* Normal mode booted with aforementioned error messages. While the network was up, the disk was mounted in read only mode. Thus, though sftp to my build machine worked, it would not let me fetch any files.

Thanks to Gopi, I could fix it. Just follow these simple steps:

1> cat /etc/vfstab

In the output, look for "device to mount" entry with FS type "/". It should look something similar to /dev/rdsk/c1t0d0s0.

2> mount -o remount /dev/rdsk/c1t0d0s0 # i.e. device to mount with FS type "/"

You can now copy correct modules form network and get your system up and running!