Transitioning From Oracle® Solaris 10 to Oracle Solaris 11.2

Exit Print View

Updated: December 2014
 
 

Booting a System for Recovery

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.


    Note -  On SPARC based systems, the boot net:dhcp command replaces the boot net command that is used in Oracle Solaris 10 releases.
  • 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.

How to Boot From a Backup BE for Recovery Purposes

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.

  • Boot from a backup BE as follows:
    • SPARC: Boot the system so that you can select an alternate or backup BE.
      1. Boot with the boot –L command.
        ok boot -L
      2. Select an alternate or backup BE.
        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.

      3. Boot the backup 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.

    • x86: Boot the system to identify the alternate or backup BE from the GRUB menu.
      1. When the GRUB menu is displayed, identify the backup BE.
      2. Select the backup BE, then press Return to boot that entry.

        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.

How to Boot a System For Recovery Purposes

  1. Select the appropriate boot method:
    • 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
    #
  2. Select from the following boot recovery problems:
    • 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

      Note -  Do not use the –f option unless you are sure that you want to overwrite the boot loader with the version that is on the media. See Installing GRUB 2 by Using the bootadm install-bootloader Command in Booting and Shutting Down Oracle Solaris 11.2 Systems .

      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
  3. Set the root password by booting to single-user mode and setting the password.

    This step assumes that you have removed an unknown root password in the previous step.

    • On an x86 based system, edit the selected boot entry in the GRUB menu, then add the –s option to the $kernel line.
    • On a SPARC based system, boot the system to single-user mode, log in as root, and set the root password. For example:
      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.