System Administration Guide: Basic Administration

SPARC: How to Boot a System for Recovery Purposes

Use this procedure when an important file, such as /etc/passwd, has an invalid entry and causes the boot process to fail.

Substitute the device name of the file system to be repaired for the devicename variable in the following procedures. If you need help identifying a system's device names, refer to “Accessing Devices (Overview)” in System Administration Guide: Devices and File Systems.

  1. Stop the system by using the system's stop key sequence.

    Use the stop sequence for your system if you don't know the root password or if you can't log in to the system. For more information, see SPARC: How to Stop the System for Recovery Purposes.

  2. Follow the instructions in the table, depending on whether you are booting from the Solaris installation CD or DVD or from the network.

    Boot Type 

    Action 

    Solaris installation CD or DVD 

    1. Insert the Solaris installation media into the drive. 

    2. Boot from the installation media in single-user mode: 

    ok boot cdrom -s

    The network if an installation server or remote CD or DVD drive are available 

    Use the following command: 

    ok boot net -s

  3. Mount the file system that contains the file with an invalid entry.


    # mount /dev/dsk/device-name /a
    
  4. Change to the newly mounted file system.


    # cd /a/file-system
    
  5. Set the terminal type.


    # TERM=sun
    # export TERM
    
  6. Remove the invalid entry from the file by using an editor.


    # vi filename
    
  7. Change to the root (/) directory.


    # cd /
    
  8. Unmount the /a directory.


    # umount /a
    
  9. Reboot the system.


    # init 6
    
  10. Verify that the system booted to run level 3.

    The login prompt is displayed when the boot process has finished successfully.


    hostname console login:

SPARC: Example—Booting a System for Recovery Purposes (Damaged Password File)

The following example shows how to repair an important system file (in this case, /etc/passwd) after booting from a local CD-ROM.


ok boot cdrom -s
# mount /dev/dsk/c0t3d0s0 /a
# cd /a/etc
# TERM=vt100
# export TERM
# vi passwd
(Remove invalid entry)
# cd /
# umount /a
# init 6

SPARC: Example—Booting a System if You Forgot Root Password

The following example shows how to recover when you forget the root password by booting from the network. This example assumes that the network boot server is already available. Be sure to apply a new root password after the system has rebooted.


ok boot net -s
# mount /dev/dsk/c0t3d0s0 /a
# cd /a/etc
# TERM=vt100
# export TERM
# vi shadow
(Remove root's encrypted password string)
# cd /
# umount /a
# init 6