System Administration Guide: Basic Administration

ProcedureSPARC: 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.

Use the stop sequence described in this procedure if you do not 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.

Substitute the device name of the file system to be repaired for the device-name variable in the following procedure. If you need help identifying a system's device names, refer to Displaying Device Configuration Information in System Administration Guide: Devices and File Systems.

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

  2. Boot the system in single-user mode.

    • Boot the system from the Solaris Software 1 CD or DVD,

      • Insert the Solaris installation media into the drive.

      • Boot from the installation media in single-user mode.


        ok boot cdrom -s
        
    • Boot the system from the network if an installation server or remote CD or DVD drive is not available.


      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:

Example 13–3 SPARC: 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


Example 13–4 SPARC: Booting a System if You Forgot the root Password

The following example shows how to boot the system from the network when you have forgotten the root password. 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