To be able to troubleshoot booting issues, sometimes we have to boot the system in single user mode using the CDROM. This is required to access the root file system and find out the issue causing the boot problem. This post describes how to boot using CDROM and mount a zfs root file system (rpool).
1. Boot the system from a CDROM in single user mode.
ok boot cdrom -s Boot device: /pci@8,700000/scsi@1/disk@6,0:f File and args: -s SunOS[TM] Release 5.10 Version Generic_137137-09 64-bit Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
2. Import the ZFS root pool on the /mnt mountpoint to allow modifying or checking files in the boot environment (BE) :
# zpool import -R /mnt rpool cannot mount '/mnt/export': failed to create mountpoint cannot mount '/mnt/export/home': failed to create mountpoint cannot mount '/mnt/rpool': failed to create mountpoint
3. List the zfs filesystems :
# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 16.7G 16.5G 94K /mnt/rpool rpool/ROOT 8.30G 16.5G 18K legacy rpool/ROOT/sol10-u6 21.1M 16.5G 8.20G /mnt rpool/ROOT/sol10-u6-patch 8.28G 16.5G 8.20G /mnt rpool/ROOT/sol10-u6-patch@sol10-u6-patch 85.2M - 8.20G - rpool/dump 2.00G 16.5G 2.00G - rpool/export 411M 16.5G 411M /mnt/export rpool/export/home 19K 16.5G 19K /mnt/export/home rpool/swap 6G 22.5G 16K -
4. Mount the data set which contains the operating system :
# zfs mount rpool/ROOT/sol10-u6 # df -k Filesystem kbytes used avail capacity Mounted on /ramdisk-root:a 171135 168424 0 100% / /devices 0 0 0 0% /devices ctfs 0 0 0 0% /system/contract proc 0 0 0 0% /proc mnttab 0 0 0 0% /etc/mnttab swap 3753208 344 3752864 1% /etc/svc/volatile objfs 0 0 0 0% /system/object sharefs 0 0 0 0% /etc/dfs/sharetab swap 3753464 600 3752864 1% /tmp /tmp/dev 3753464 600 3752864 1% /dev fd 0 0 0 0% /dev/fd swap 3752864 0 3752864 0% /tmp/root/var/run rpool/ROOT/sol10-u6 34836480 8597005 17316644 34% /mnt
5. Access the boot environment via the mount point:
# cd /mnt # ls a devices kernel platform ssd_state2.out b dtrace.d kk policia storage bin dtrace.out lib proc system boot etc mbox rmdisk tmp cdrom export mnt rpool truss.out core file mnt2 sbin usr data file+ net ssd_out var dev home opt ssd_state.out vol
6. When finished, export the root pool and reboot :
# cd / # zpool export rpool # zpool list no pools available # reboot