C H A P T E R  7

Recovering File Systems

This chapter describes how to recover data when a SAM-QFS file system is corrupted or lost. These procedures differ, depending on the type of file system and whether or not you have a samfsdump(1M) of the file system available. You might require the assistance from your ASP or a Sun Microsystems customer support staff member for this process to be successful.

This chapter covers the following topics


Recovering a SAM-QFS File System With a Metadata Dump File

If you have samfsdump(1M) metadata output for a file system, you can use the samfsrestore(1M) command to recover a file system that has been corrupted, accidentally remade, or destroyed. For details about the syntax and options used in the procedure, see the samfsdump(1M) man page.


procedure icon  To Restore a File System Using File System Manager

1. From the Servers page, click the name of the server on which the file system that you want is located.

The File Systems Summary page is displayed.

2. Select the radio button next to the file system for which you want to restore files.

3. From the Operations drop-down menu, choose Restore.

The Restore File System page is displayed.

4. If the metadata snapshot file is displayed as a link in the Metadata Snapshot Summary table, skip to the next step. Otherwise, make the snapshot available by selecting the radio button next to the snapshot that is unavailable and click Make Available for Browsing.

5. Perform either of the following in the Metadata Snapshot Summary table:

The Restore File System page is refreshed and the top-level items in the selected metadata snapshot are displayed in the Metadata Snapshot Entries table.

6. Under Restore Type select Entire File System.

7. From the Online Status After Restoring drop-down menu, choose how you want the file restored.

8. Click Restore.



Note - The File System Manager software can only restore files from snapshots created by the File System Manager software.




procedure icon  To Restore a File System Using the Command Line Interface

This example restores a file system from a samfsdump dump file called /dump_sam1/dump/041126.

1. Use the cd(1M) command to change to the mount point for the file system or to the directory location where you want to restore the file system.



caution icon

Caution - Consider restoring the file system first into a temporary directory and verifying that the restoration succeeds before restoring directly into the existing file system. This removes the risk of destroying the current file system before you can be sure the restoration is going to work. If the restoration fails, the file system may be recoverable by some other process.



In the following example, the mount point is /sam1.


# cd /sam1

2. Use the samfsrestore command with the -T and -f options to restore the entire file system relative to the current directory.

Use the syntax shown in the following screen example, specifying the pathname of the dump file after the -f option, and the pathname of the restore log file after the
-g option.


# samfsrestore -T -f /dump_sam1/dumps/041126 -g log



Note - The log file that is created in the previous screen example can be used as input to restore.sh(1M) script to stage back files that were online at the time of the dump.




Recovering a SAM-QFS File System Without a Dump File

You may be able to recover data from a SAM-QFS file system even if you do not have access to output from a samfsdump(1M) command, or to an archiver log file.

The following procedure shows you how to recreate user files by reloading tape or optical disk and using the star(1M) command's -n option.



Note - Recovering file systems from archive cartridges and using the star command is a tedious and time-consuming process. This should not be considered the normal condition for disaster recovery.




procedure icon  To Recover Without a Dump File

1. (Optional) Disable any automated processes that are related to Sun StorEdge SAM-FS operations.

If you have any of the following automated processes running, disable them during the recovery process to ensure that no data is lost:

2. (Optional) Disable NFS-sharing for the file system.

It can be easier to recover data if the file system is not NFS-sharing the file systems during the recovery period.

3. Use the sammkfs(1M) command to remake the SAM-QFS file system to be restored.

4. Identify the cartridges that contain the archive copy information.

5. Read all the archive media.

If you are using tapes, use tar(1M), gnutar(1M), or star(1M).

6. If recovering from tape media, use the tarback.sh script.

The tarback.sh(1M) script is described in Disaster Recovery Commands and Tools. For more information about this script, see the tarback.sh man page. See also Unreadable Label - No Other Copies Available for an example of how to use the script.

The script is located in /opt/SUNWsamfs/examples/tarback.sh. This script identifies a single tape drive for use during recovery, and provides a list of VSNs to recover. The script uses star(1M) to loop through a volume, reading all available archive files.

The star(1M) command is an enhanced version of gnutar(1M). The tarback.sh script uses star(1M) and the -n option, which is a star(1M) extension to gnutar(1M). The -n option restores only files that are newer than the existing copy. If the archive copy you are about to restore is older than the existing copy, the restore is skipped. This is important because it means that you do not have to worry about reading archive media in a specific order.

7. If recovering from magnetic-optical media, contact Sun support.