System Administration Guide, Volume I

How to Restore the root (/) and /usr File Systems

  1. Add a new system disk to the system where the root (/) and /usr file systems will be restored.

    For a detailed description about adding a system disk, refer to Chapter 23, SPARC: Adding a Disk (Tasks) or Chapter 24, x86: Adding a Disk (Tasks).

  2. Mount the new file system on a temporary mount point.


    # mount /dev/dsk/device-name /mnt
    
  3. Change to the /mnt directory.


    # cd /mnt
    
  4. Write-protect the tapes.

  5. Use the ufsrestore command to restore the root file system.


    # ufsrestore rvf /dev/rmt/n
    

    The level 0 tape is restored.

  6. Remove the tape and load the next level tape in the drive.

    Always restore tapes starting with 0 and continuing from lowest to highest level.

  7. Continue to use the ufsrestore command as needed.


    # ufsrestore rvf /dev/rmt/n
    

    The next level tape is restored.

  8. Repeat Step 6 and Step 7 for each additional tape.

  9. Verify the file system is restored.


    # ls
    
  10. Remove the restoresymtable file.


    # rm restoresymtable
    

    Removes the restoresymtable file that is created and used by ufsrestore to check point the restore.

  11. Change to the root (/) directory.


    # cd /
    
  12. Unmount the newly created file system.


    # umount /mnt
    
  13. Check the new file system.


    # fsck /dev/rdsk/device-name
    

    The restored file system is checked for consistency.

  14. Create the boot blocks on the root partition by using the installboot(1M) command.


    # installboot  /usr/platform/`uname-i`/lib/fs/ufs/bootblk /dev/rdsk/devicename
    

    See "Example--Restoring the root (/) File System on a SPARC System" for an example of using the installboot command on a SPARC system or "Example--Restoring the root (/) File System on an x86 System" for an example of using the installboot command on an x86 system.

  15. Insert a new tape in the tape drive.

  16. Back up the new file system.


    # ufsdump 0uf /dev/rmt/n /dev/rdsk/device-name
    

    A level 0 backup is performed. Always do an immediate backup of a newly created file system because ufsrestore repositions the files and changes the inode allocation.

  17. Repeat steps 5 through 18 for the /usr file system, if necessary.

  18. Reboot the system.


    # init 6
    

    The system is rebooted.

Example--Restoring the root (/) File System on a SPARC System


# mount /dev/dsk/c0t3d0s0 /mnt
# cd /mnt
# tapes
# ufsrestore rvf /dev/rmt/0
# ls
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/c0t3d0s0
# installboot /usr/platform/sun4m/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0
# init 6

Example--Restoring the root (/) File System on an x86 System


# mount /dev/dsk/c0t3d0s0 /mnt
# cd /mnt
# tapes
# ufsrestore rvf /dev/rmt/0
# ls
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/c0t3d0s0
# installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot  /usr/platform/`uname -i`/lib/fs/
ufs/bootblk /dev/rdsk/c0t3d0s0
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0
# init 6