Performing File system Restore including incremental back up (solaris 10)

The ufsrestore command copies files to the disk, relative to the current
working directory, from backup tapes that were created by the ufsdump command.

The syntax for the ufsrestore command is:
ufsrestore option(s) argument(s) filesystem


The following procedure demonstrates how to use the ufsrestore command to restore the /export/home file system on the c0d1s7 slice.

1. Create the new file system structure.

# newfs /dev/rdsk/c0d1s7


2. Mount the file system to the /export/home directory, and change to that directory.

# mount /dev/dsk/c0d1s7 /export/home

# cd /export/home


3. Restore the entire /export/home file system from the backup tape.

# ufsrestore rf /dev/rmt/0


Note – Always restore a file system by starting with the Level 0 backup tape, continuing with the next-lower-level tape, and continuing through the highest-level tape.


4. Remove the restoresymtable file.

# rm restoresymtable

Remove the restoresymtable file when the restore is complete.


5. Unmount the new file system.

# cd /

# umount /export/home


6. Use the fsck command to check the restored file system.

# fsck /dev/rdsk/c0d1s7


7. Perform a full backup of the file system.

# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0d1s7

The ufsrestore command repositions the files and changes the inode allocation.


8. init 6



Using the ufsrestore Command to Restore a Critical File System

The following procedure demonstrates how to restore the /usr file system on Slice 6 of the boot disk.

1. Insert the Solaris 10 Software 1 CD-ROM or DVD, and boot from it with the     single-user mode option.

ok boot cdrom -s


2. Create the new file system structure.

# newfs /dev/rdsk/c0t0d0s6


3. Mount the file system to the mount point /a, and change to that directory.

# mount /dev/dsk/c0t0d0s6 /a

# cd /a


4. Restore the entire /usr file system from the backup tape.

# ufsrestore rf /dev/rmt/0


5. Remove the restoresymtable file.

# rm restoresymtable


6. Unmount the new file system.

# cd /
# umount /a


7. Use the fsck command to check the restored file system.

# fsck /dev/rdsk/c0t0d0s6


8. Perform a full backup of the file system.

# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s6


9. Reboot the system.

# init 6



Invoking an Interactive Restore
The following procedure demonstrates how to use the ufsrestore i command to extract individual files from a backup tape.

1. Become the root user, and change to the temporary directory that you want     to receive the extracted files.

# cd /export/home/tmp


2. Perform the ufsrestore i command.

# ufsrestore ivf /dev/rmt/0


3. Display the contents of the directory structure on the backup tape.

ufsrestore > ls
.:
     2 *./      13 directory1 15 directory3 11 file2
     2 *../     14 directory2 10 file1      12 file3


4. Change to the target directory on the backup tape.

ufsrestore > cd directory1
ufsrestore > ls
./directory1:
  3904 ./           2 *../ 3905 file1 3906 file2 3907 file3


5. Add the files you want to restore to the extraction list.

ufsrestore > add file1 file2
Make node ./directory1

Files you want to restore are marked with an asterisk (*) for extraction.
If you extract a directory, all of the directory contents are marked for extraction.

In this example, two files are marked for extraction.
The ls command displays an asterisk in front of the selected file names, file1 and file2.

ufsrestore > ls
./directory1:
  3904 *./      2 *../ 3905 *file1 3906 *file2 3907 file3


6. To delete a file from the extraction list, use the delete command.

ufsrestore > delete file1

The ls command displays the file1 file without an asterisk.

ufsrestore > ls
./directory1:
  3904 *./      2 *../ 3905 file1 3906 *file2 3907 file3


7. To view the files and directories marked for extraction, use the marked
   command.

ufsrestore > marked
./directory1:
  3904 *./          2 *../ 3906 *file2


8. To restore the selected files from the backup tape, perform the command:

ufsrestore > extract

Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1

extract file ./directory1/file2
Add links
Set directory mode, owner, and times.
set owner/mode for ‘.’? [yn] n

Answering y sets ownership and permissions of the temporary directory to those of the mount point on the tape.


9. To exit the interactive restore after the files are extracted, perform the
   command:

ufsrestore> quit


10. Move the restored files to their original or permanent directory
    location, and delete the files from the temporary directory.

# mv /export/home/tmp/directory1/file2 /export/home

# rm -r /export/home/tmp/directory1


Note – You can use the help command in an interactive restore to display a list of available commands.



Performing an Incremental Restore
The following procedure demonstrates how to restore the /export/home file system from incremental tapes.


Note – This procedure makes use of the interactive restore to assist in showing the concept of incremental restores. You would typically use a command, such as ufsrestore rf, for restoring entire file systems.


1. View the contents of the /etc/dumpdates file for information about
   the /export/home file system.

# more /etc/dumpdates | grep c0t0d0s7

/dev/rdsk/c0t0d0s7       0 Wed Apr 07 09:55:34 2004
/dev/rdsk/c0t0d0s7       1 Web Apr 07 09:57:30 2004


2. Create the new file system structure for the /export/home file system.

# newfs /dev/rdsk/c0t0d0s7


3. Mount the file system and change to that directory.

# mount /dev/dsk/c0t0d0s7 /export/home

# cd /export/home


4. Insert the Level 0 backup tape.


5. Restore the /export/home file system from the backup tapes.

# ufsrestore rvf /dev/rmt/0


6. Load the next lower-level tape into the tape drive.

# ufsrestore rvf /dev/rmt/0



Alternative Steps


The following steps are an alternative to the previous Steps 5 and 6.

5. Restore the /export/home file system from the backup tapes. (This
   example uses an interactive, verbose restore to provide more detailed
   information.)

# ufsrestore ivf /dev/rmt/0

ufsrestore > ls

The system lists files from the last Level 0 backup.

ufsrestore > add *

ufsrestore > extract

Specify next volume #: 1

set owner/mode for ’.’? [yn] n

Directories already exist, set modes anyway? [yn] n

ufsrestore > q
#


6. The information in the /etc/dumpdates file shows an incremental
   backup that was taken after the Level 0 backup. Load the next tape
   and perform the incremental restore.

# ufsrestore ivf /dev/rmt/0

ufsrestore > ls

ufsrestore > add *

ufsrestore > extract

Specify next volume #: 1

set owner/mode for ’.’? [yn] n

ufsrestore > q