Sun Microsystems Logo
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next

Example--Restoring a Complete File System

The following example shows how to restore the /export/home file system.

# umount /export/home
# newfs /dev/rdsk/c0t0d0s7
newfs: /dev/rdsk/c0t0d0s7 last mounted as /export/home
newfs: construct a new file system /dev/rdsk/c0t0d0s7: (y/n)? y
819314 sectors in 867 cylinders of 15 tracks, 63 sectors
        400.1MB in 55 cyl groups (16 c/g, 7.38MB/g, 3584 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 15216, 30400, 45584, 60768, 75952, 91136, 106320, 121504, 136688,
 681264, 696448, 711632, 725792, 740976, 756160, 771344, 786528, 801712,
 816896,
Verify volume and initialize maps
Media block size is 126
Dump   date: Tue Oct 07 08:41:41 2003
Dumped from: the epoch
Level 0 dump of a partial file system on starbug:/export/home/kryten
Label: none
Begin level 0 restore
Initialize symbol table.
Extract directories from tape
Calculate extraction list.
Extract new leaves.
Check pointing the restore
extract file ./export/home/kryten/filea
extract file ./export/home/kryten/fileb
extract file ./export/home/kryten/filec
extract file ./export/home/kryten/letters/letter1
extract file ./export/home/kryten/letters/letter2
extract file ./export/home/kryten/letters/letter3
extract file ./export/home/kryten/reports/reportA
extract file ./export/home/kryten/reports/reportB
extract file ./export/home/kryten/reports/reportC
Add links
Set directory mode, owner, and times.
Check the symbol table.
Check pointing the restore
# mount /dev/dsk/c0t0d0s7 /mnt
# cd /mnt
# ufsrestore rvf /dev/rmt/0
# ls
# rm restoresymtable
# cd /
# umount /mnt
# ufsdump 0ucf /dev/rmt/0 /export/home
                    .
                    .
                    .
# mount /dev/dsk/c0t3d0s7 /export/home
# ls /export/home

ProcedureHow 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 34, SPARC: Adding a Disk (Tasks) or Chapter 35, 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. Create the links for the tape device.

    # tapes

  7. Restore the root file system.

    # ufsrestore rvf /dev/rmt/n

    The dump level 0 tape is restored.

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

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

  9. Continue restoring as needed.

    # ufsrestore rvf /dev/rmt/n

    The next level tape is restored.

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

  11. Verify that the file system is restored.

    # ls

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

  13. Change to the root (/) directory.

    # cd /

  14. Unmount the newly created file system.

    # umount /mnt

  15. Check the new file system.

    # fsck /dev/rdsk/device-name

    The restored file system is checked for consistency.

  16. 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 theinstallboot(1M) man page.

    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 x86 based system, see x86: Example--Restoring the root (/) File System.

  17. Insert a new tape in the tape drive.

  18. Back up the new file system.

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

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

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

  20. Reboot the system.

    # init 6

    The system is rebooted.

Previous Previous     Contents     Index     Next Next