System Administration Guide, Volume 1

How to Restore a Complete File System

Note -

You cannot use this procedure to restore root (/) or /usr. See "How to Restore the root (/) and /usr File Systems" for instructions on restoring these file systems.

  1. Become superuser.

  2. If necessary, unmount the file system.

    # umount /dev/rdsk/device-name
  3. Create the new file system with the newfs(1M) command.

    # newfs /dev/rdsk/device-name

    You are asked if you want to construct a new file system on the raw device. Verify that the device-name is correct so you don't destroy the wrong file system.

  4. Confirm that the new file system should be created.

    newfs: construct a new file system /dev/rdsk/cwtxdysz:(y/n)? y

    The new file system is created.

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

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

    # cd /mnt

    You have changed to the mount-point directory.

  7. Write-protect the tapes.

  8. Insert the first volume of the level 0 tape into the tape drive.

  9. Use the ufsrestore command to restore the files on the tapes.

    # ufsrestore rvf /dev/rmt/n

    The level 0 dump is restored. If the dump required multiple tapes, you would be prompted to load each tape in numeric order.

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

    Always restore tapes starting with 0 and continuing until you reach the highest level.

  11. Repeat Step 7 through Step 10 for each level of dump, from the lowest to the highest level.

  12. Verify the file system is restored.

    # ls
  13. Remove the restoresymtable file.

    # rm restoresymtable

    The restoresymtable file created by ufsrestore is removed.

  14. Change to another directory.

    # cd /
  15. Unmount the newly restored file system.

    # umount /mnt
  16. Remove the last tape and insert a new tape that is not write-protected in the tape drive.

  17. Use the ufsdump command to make a level 0 backup of the newly restored file system.

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

    You should always do an immediate backup of a newly created file system, because ufsrestore repositions the files and changes the inode allocation (the restored file system will appear to have changed since the previous backup).

  18. Mount the restored file system.

    # mount /dev/dsk/device-name mount-point

    The restored file system is mounted and available for use.

  19. Verify the restored and mounted file system is available.

    # ls mount-point

Example--Restoring a Complete File System

The following example restores the /export/home file system.

# umount /export/home
# newfs /dev/rdsk/c0t3d0s7
newfs: construct a new file system /dev/rdsk/c0t3d0s7: (y/n)? y
/dev/rdsk/c0t3d0s7:	410400 sectors in 270 cylinders of 19 tracks, 80 sectors
		200.4MB in 17 cyl groups (16 c/g, 11.88MB/g, 5696 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 24432, 48832, 73232, 97632, 122032, 146432, 170832, 195232, 219632,
 244032, 268432, 292832, 317232, 341632, 366032, 390432,
# mount /dev/dsk/c0t3d0s7 /mnt
# cd /mnt
# ufsrestore rvf /dev/rmt/0
Verify volume and initialize maps
Media block size is 126
Dump   date: Wed Jul 14 08:49:33 1999
Dumped from: the epoch
Level 0 dump of /export/home on earth:/dev/dsk/c0t3d0s7
Label: none
Begin level 0 restore
Initialize symbol table.
Extract directories from tape
Calculate extraction list.
Warning: ./lost+found: File exists
Make node ./kryten
Make node ./kryten/letters
Make node ./kryten/reports
Extract new leaves.
Check pointing the restore
extract file ./kryten/.cshrc
extract file ./kryten/.login
extract file ./kryten/b
extract file ./kryten/memos
extract file ./kryten/letters/b
extract file ./kryten/letters/letter1
extract file ./kryten/letters/letter2
extract file ./kryten/letters/letter3
extract file ./kryten/reports/reportA
extract file ./kryten/reports/reportB
extract file ./kryten/reports/reportC
Add links
Set directory mode, owner, and times.
Check the symbol table.
Check pointing the restore
# ls
# rm restoresymtable
# cd /
# umount /mnt
# ufsdump 0ucf /dev/rmt/0 /export/home
# mount /dev/dsk/c0t3d0s7 /export/home
# ls /export/home