[Next] [Previous] [Up] [Top] [Contents]

16.3 Backup and Restore Commands

16.3.3 Restore

You can restore entire file systems or you can interactively restore individual files with the restore program, restore (SunOS 4.1.X) or ufsrestore (SunOS 5.X). These programs restore files relative to your current directory. On a full restore they place a file, restoresymtable, in the current directory, that's used to pass information to a further instance of restore, for restoring incremental dumps. This file can be safely removed only after all of the incremental dumps have been restored.

To do a complete restore of a damaged file system, e.g. /dev/sd0h, you might try:

# newfs /dev/rsd0h - to clear and re-create the file system.

# mount /dev/sd0h /mnt - to mount the file system temporarily.

# cd /mnt - move to the new file system.

# restore -r - restore a level 0 dump of the file system.

Later, incremental dumps can then be restored.

# umount /mnt - unmount the file system.

# fsck /dev/rsd0h - check the file system for consistency.

# mount /dev/sd0h /home - mount the file system

Restore can also be run interactively and you can specify the device, e.g.:

# restore -if /dev/rst9

restore then first recreates the file system in memory so that you can use some UNIX type commands, i.e. ls, cd, and pwd, to move around the file system. You can then "add" entries to a table of files to "extract" from the tape.

A special case is restoration of the root file system. For this you need to boot from tape or CDROM. After restoring the file system you also need to re-install the boot block program, bootblk. This is done with installboot, as in the following for a SCSI disk on SunOS 4.1.X:

# /usr/mdec/installboot /boot bootsd /dev/rsd0a

and for SunOS 5.X:

# /usr/sbin/installboot /usr/platform/'uname -i'/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0

As you can see the syntax is dependent on both the hardware platform and software version, so read the man page before using installboot.


Unix System Administration - 8 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]