How to Boot From Media to Resolve an Unknown root Password
Use the following procedure if you need to boot the system to correct an unknown root password or similar problem. This procedure requires you to mount the boot environment after importing the root pool. If you need to recover a root pool or root pool snapshot, see Replacing Disks in a ZFS Root Pool in Managing ZFS File Systems in Oracle Solaris 11.4.
Before You Begin
Ensure that your role has the appropriate rights profiles to perform this procedure. See Using Rights Profiles to Administer Boot Features.
Boot from the Oracle Solaris media by using one of the following
SPARC: Text installation – Boot from the installation media or from the network, then select the Shell option (option 3) 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: Text installation – From the GRUB menu, select the Text Installer and command line boot entry, then select the Shell option (option 3) from the text installation screen.
x86: Automated installation – Boot from an AI server on the network. Select the Text Installer and command line entry from the GRUB menu. Then, select the Shell option (option 3) from the text installation screen.
Import the root pool.
zpool import -f rpool
Create a mount point for the boot environment.
$ mkdir /a
Mount the boot environment on the mount point /a.
$ beadm mount solaris-instance|be-name /a
$ beadm mount solaris-2 /a
If a password or shadow entry is preventing a console login, correct the problem.
Set the TERM type.
$ export TERM
Edit the shadow file.
$ cd /a/etc
$ vi shadow
$ cd /
Update the boot archive.
$ bootadm update-archive -R /a
Unmount the boot environment.
$ beadm umount be-name
Halt the system.
Reboot the system to a single-user state, and when prompted for the root password, press Return.
Reset the root password.
$ passwd -r files root
New Password: xxxxxx
Re-enter new Password: xxxxxx
passwd: password successfully changed for root
Press Control-D to reboot the system.