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 How to Replace a Disk in a ZFS Root Pool (SPARC or x86/VTOC) in Managing ZFS File Systems in Oracle Solaris 11.2
.
- Boot from the Oracle Solaris media by using one of the following
options:
- 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: Live Media – Boot from the installation media, and
use a GNOME terminal for the recovery procedure.
- 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 install server
on the network. This method requires a PXE boot. 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
For example:
# beadm mount solaris-2 /a
- If a password or shadow entry is preventing a console login, correct
the problem.
- Set the TERM type.
# TERM=vt100
# 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.
# halt
- Reboot the system to a single-user state, and when prompted for
the root password, press Return.
- Reset the root password.
root@system:~# 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.
See also
If there is a problem with the GRUB configuration that requires you
to boot the system from media, follow the same steps for x86 platforms that
are in this procedure> However, you