System Administration Guide

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. Create the tape device entries.


    # tapes
    
  5. Write-protect the tapes.

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


    # ufsrestore rvf /dev/rmt/n
    

    The level 0 tape is restored.

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

  8. Continue to use the ufsrestore command as needed.


    # ufsrestore rvf /dev/rmt/n
    

    The next level tape is restored.

  9. Repeat steps 7 and 8 for each additional tape.

  10. Verify the file system is restored.


    # ls
    
  11. Remove the restoresymtable file.


    # rm restoresymtable
    

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

  12. Change to the root (/) directory.


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


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


    # fsck /dev/rdsk/device-name
    

    The restored file system is checked for consistency.

  15. Create the boot blocks on the root partition by using the installboot 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.

  16. Insert a new tape in the tape drive.

  17. 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.

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

  19. 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/`uname -i`/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