System Administration Guide: Basic Administration

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

  1. Become superuser or assume an equivalent role.

  2. 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 33, SPARC: Adding a Disk (Tasks) or Chapter 34, x86: Adding a Disk (Tasks).

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


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


    # cd /mnt
    
  5. (Optional) Write-protect the tapes for safety.

  6. 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 dump level 0 and continuing from lowest to highest level.

  8. Continue restoring as needed.


    # ufsrestore rvf /dev/rmt/n
    

    The next level tape is restored.

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

  10. Verify the file system is restored.


    # ls
    
  11. Remove the restoresymtable file.


    # rm restoresymtable
    

    The restoresymtable file that is created and used by the ufsrestore command to check-point the restore is removed.

  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.


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

    For more information, see installboot(1M).

    For an example of using the installboot command on a SPARC based system, see SPARC: Example—Restoring the root (/) File System. For an example of using the installboot command on an IA based system, see x86: Example—Restoring the root (/) File 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 16 for the /usr file system, if necessary.

  19. Reboot the system.


    # init 6
    

    The system is rebooted.

SPARC: Example—Restoring the root (/) File System

This example shows how to restore the root (/) file system on a SPARC system. This example assumes that the system is booted from a local CD or from the network.


# 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

x86: Example—Restoring the root (/) File System

This example shows how to restore the root (/) file system on a IA system. This example assumes that the system is booted from a local CD or from the network.


# 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/c0t3d0s2
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0
# init 6