Example--Restoring a Complete File System
The following example shows how to restore 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: Sat Jul 14 08:49:33 2001 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 |
How to Restore the root (/) and /usr File Systems
Become superuser or assume an equivalent role.
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, IA: Adding a Disk (Tasks).
Mount the new file system on a temporary mount point.
# mount /dev/dsk/device-name /mnt
Change to the /mnt directory.
# cd /mnt
(Optional) Write-protect the tapes for safety.
Restore the root file system.
# ufsrestore rvf /dev/rmt/n
The level 0 tape is restored.
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.
Continue restoring as needed.
# ufsrestore rvf /dev/rmt/n
The next level tape is restored.
Verify the file system is restored.
# ls
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.
Change to the root (/) directory.
# cd /
Unmount the newly created file system.
# umount /mnt
Check the new file system.
# fsck /dev/rdsk/device-name
The restored file system is checked for consistency.
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 "IA: Example--Restoring the root (/) File System".
Insert a new tape in the tape drive.
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.
Repeat steps 5 through 16 for the /usr file system, if necessary.
Reboot the system.
# init 6
The system is rebooted.