If an Oracle Solaris 11 system becomes unbootable, you most likely will need to perform a recovery boot. You can boot from installation media, or you can boot a backup BE.
If you need to perform complete system (bare metal) recovery, see How to Create a Recovery Archive in Using Unified Archives for System Recovery and Cloning in Oracle Solaris 11.2 .
The following error and recovery scenarios are similar to previous releases:
You can use the boot –a command to bypass a problem in the /etc/system file. When prompted, use syntax that is similar to the following:
Name of system file [/etc/system]: /dev/null
Press Return at the other prompts, as needed.
A backup BE is created automatically during most pkg update operations. This feature enables you to boot back to a previous BE in case some error occurs during the image update process. Consider creating a backup BE before you make a system configuration change.
# beadm create solaris-backup # beadm list BE Active Mountpoint Space Policy Created -- ------ ---------- ----- ------ ------- solaris R - 4.01G static 2013-02-08 16:53 solaris-backup N / 47.95M static 2013-02-11 10:48
See How to Boot From a Backup BE for Recovery Purposes for the steps to boot from a backup BE.
Boot from the installation media or from an install server over the network to recover from a problem that is preventing the system from booting or to recover from a lost root password.
Boot a system in single-user mode to resolve a minor problem, such as correcting the root shell entry in the /etc/passwd file or changing a NIS server.
Resolving a boot configuration problem generally involves importing the root pool, mounting the BE, and fixing the problem, for example reinstalling a corrupt x86 boot loader.
Booting the failsafe archive is no longer supported on SPARC and x86 platforms. Whenever possible, use up-to-date backup BEs for recovery purposes. BEs are bootable instances of the Oracle Solaris image, plus any other application software packages that are installed into that image. Multiple BEs reduce risk when updating software because the backup BE preserves the original BE.
You can create a new BE based on an active or an inactive boot environment. Or, you can create a new BE based on a clone of your original BE. A clone copies the root dataset and everything hierarchically under the main root dataset of the original BE. See Creating and Administering Oracle Solaris 11.2 Boot Environments .
If the system does not boot from the active BE, select a backup BE from which to boot.
ok boot -L
Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0,0:a File and args: -L 1 Oracle Solaris 11.2 SPARC 2 solaris-backup Select environment to boot: [ 1 - 2 ]: 2
In the previous output, the active BE is Oracle Solaris 11.2 SPARC, which most likely does not match the actual BE name, but it represents the current BE.
After you select the BE from which to boot, identify the on-screen boot path and type that information at the prompt.
To boot the selected entry, invoke: boot [<root-device>] -Z rpool/ROOT/solaris-backup Program terminated {0} ok boot -Z rpool/ROOT/solaris-backup
If the system does not boot, review the additional boot recovery steps in How to Boot a System For Recovery Purposes.
If the system does not boot from the backup BE, review the additional boot recovery steps in How to Boot a System For Recovery Purposes.
x86: Live Media – Boot from the installation media and use a GNOME terminal for the recovery procedure.
SPARC: Text installation – Boot from the install media or from the network, and select option 3 Shell from the text installation screen.
x86: Text installation – From the GRUB menu, select the Text Installer and command line boot entry, then select the option 3 Shell from the text installation screen.
SPARC: Automated installation – Use the following command to boot directly from an installation menu that allows you to exit to a shell.
ok boot net:dhcp
x86: Automated installation – Booting from an install server on the network requires a PXE boot. Select the Text Installer and command line entry from the GRUB menu. Then, select the option 3 Shell from the text installation screen.
For example, after the system is booted, select option 3 Shell.
1 Install Oracle Solaris 2 Install Additional Drivers 3 Shell 4 Terminal type (currently xterm) 5 Reboot Please enter a number [1]: 3 To return to the main menu, exit the shell #
Resolve a bad root shell by booting the system to single-user mode and correcting the shell entry in the /etc/passwd file.
On an x86 based system, edit the selected boot entry in the GRUB menu, then add the –s kernel argument to the end of the $kernel line.
On a SPARC based system, shut down the system and boot to single-user mode. After you log in as the root user, edit the /etc/passwd file, and fix the root shell entry.
# init 0 ok boot -s Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0,0:a ... SunOS Release 5.11 Version 11.2 64-bit Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved. Booting to milestone "milestone/single-user:default". Hostname: systema.domain Requesting System Maintenance Mode SINGLE USER MODE Enter user name for system maintenance (control-d to bypass): root Enter root password (control-d to bypass): xxxxxxx single-user privilege assigned to root on /dev/console. Entering System Maintenance Mode Aug 3 15:46:21 su: 'su root' succeeded for root on /dev/console Oracle Corporation SunOS 5.11 11.2 July 2013 su: No shell /usr/bin/mybash. Trying fallback shell /sbin/sh. root@systema.domain:~# TERM =vt100; export TERM root@systema.domain:~# vi /etc/passwd root@systema.domian:~# <Press control-d> logout svc.startd: Returning to milestone all.
Resolve a corrupt boot loader problem.
First, boot from media or the network by using one of the boot methods that are listed in Step 1. Then, import the root pool.
# zpool import -f rpool
Then, reinstall the boot loader as follows:
# bootadm install-bootloader -f -P rpool
where –f forces the installation of the boot loader and bypasses any checks related to not downgrading the version of the boot loader on the system. The –P option specifies the root pool.
Exit and reboot the system.
# exit 1 Install Oracle Solaris 2 Install Additional Drivers 3 Shell 4 Terminal type (currently sun-color) 5 Reboot Please enter a number [1]: 5
Confirm that the system boots successfully.
Resolve an unknown root password that prevents you from logging into the system.
First, you must boot from media or the network by using one of the boot methods that are listed in Step 1. Then, import the root pool (rpool) and mount the BE to remove the root password entry. This process is identical on SPARC and x86 platforms.
# zpool import -f rpool # beadm list be_find_current_be: failed to find current BE name be_find_current_be: failed to find current BE name BE Active Mountpoint Space Policy Created -- ------ ---------- ----- ------ ------- solaris - - 11.45M static 2011-10-22 00:30 solaris-2 R - 12.69G static 2011-10-21 21:04 # mkdir /a # beadm mount solaris-2 /a # TERM=vt100 # export TERM # cd /a/etc # vi shadow <Carefully remove the unknown password> # cd / # beadm umount solaris-2 # halt
This step assumes that you have removed an unknown root password in the previous step.
ok boot -s Boot device: /pci@780/pci@0/pci@9/scsi@0/disk@0,0:a File and args: -s SunOS Release 5.11 Version 11.2 64-bit Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved. Booting to milestone "milestone/single-user:default". Hostname: systema.domain Requesting System Maintenance Mode SINGLE USER MODE Enter user name for system maintenance (control-d to bypass): root Enter root password (control-d to bypass): <Press return> single-user privilege assigned to root on /dev/console. Entering System Maintenance Mode . . . root@sysadma.domain:~# passwd -r files root New Password: xxxxxx Re-enter new Password: xxxxxx passwd: password successfully changed for root root@systema.central:~# <Press control-d> logout svc.startd: Returning to milestone all.