C H A P T E R  5

Restoring Files and Directories

This chapter describes how to restore individual files and directories. It covers the following topics:

TABLE 5-1 lists the tasks for restoring files and directories with cross references to where the procedures are located.


TABLE 5-1 Tasks for Restoring Files and Directories

Where Described

Notes

  1. Restoring Regular Files and Directories With samfsdump(1M) Output[1].
  2. Restoring Files and Directories Without samfsdump(1M) Output[2].
  3. Restoring Files Archived to Disk.
  4. Retrieving Unarchived Files From File Systems.

 

The first two procedures are for restoring files archived to tape or magneto-optical cartridges. These procedures are effective only if recent samfsdump files and recent archive copies of the files being restored are available.




Note - If the mv(1) command has been used to move an archived file to a different directory, the file is not rearchived. If you use the star(1M) command to recover a moved file, the star(1M) header on the archive media retains the original path name. When you use the star(1M) command to reload the file, the file is restored to its original location.

You can see the path by issuing the star(1M) command with its tvbf arguments. Then, you can extract the file to its original location by issuing the star(1M) command again. Finally, issue the mv(1) command to move the file to its new directory.




Restoring Regular Files and Directories With samfsdump(1M) Output

You can use one of the following procedures to restore files and directories by using the dump file created by samfsdump(1M).



Note - samfsdump and samfsrestore work on SAM-QFS file systems but not Sun StorEdge QFS stand-alone file systems. If needed, see the Sun StorEdge QFS Configuration and Administration Guide.




procedure icon  To Restore Files 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. Find the files that you want to restore.

For complete instructions on finding the files you want to restore, see the File System Manager online help file.

7. In the Metadata Snapshot Entries table, select the radio button next to the file or directory that you want to restore.

The file or directory that you select is displayed in the File to Restore field.

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

9. 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 Using a samfsdump(1M) File

The example in this procedure uses the samfsrestore(1M) command to restore a lost file from a dump file created by the samfsdump command. It restores a file (pathname: /sam1/mary/mary1) from a samfsdump metadata dump file called /dump_sam1/041126. The example creates a temporary restoration directory called restore in the /sam1 file system.

1. Use the mkdir(1) command to create a directory in which to restore the files within a SAM-QFS file system.


# mkdir restore


2. Use the archive(1) command with the -r option and -n option to prevent the archiver from archiving from this temporary directory location.


# archive -r -n restore

3. Use the cd(1) command to change to the temporary restoration directory.


# cd restore

4. Use the samfsrestore(1M) command with the -t and -f options to list the contents of the dump file.

After the -f option specify the dump file's path name as shown in CODE EXAMPLE 5-1.


CODE EXAMPLE 5-1 Listing the Content of a Dump File
# samfsrestore -t -f /dump_sam1/041126
samfsrestore -t -f /dump_sam1/041126
./lost+found
./neptune
./mary
./fileA
./fileB
./fileC
./fileD
./fileE
./mary/mary1
./mary/mary2
./neptune/vmcore.0
./neptune/unix.0
./neptune/bounds

5. Search the listing from the previous step to verify that the lost file is in the dump file.

If you find the file you are looking for, copy down the exact path name shown in the output to use in the following step.

In the previous screen example, the lost file called mary1 is shown as residing in the ./mary directory.

6. Use the samfsrestore command with the -T and -f options to restore the file's inode information to the current directory.

The filename must match exactly the pathname as it was listed in the previous output from Step 4. The following screen example shows using samfsrestore to retrieve the file ./mary/mary1 from the dump file /dump_sam1/041126.


# samfsrestore -T -f /dump_sam1/041126 ./mary/mary1

7. Use the sls(1) command with the -D option to list detailed information about the file, and verify that the inode information for the correct file has been retrieved.

CODE EXAMPLE 5-2 shows inode information for file ./mary/mary1.


CODE EXAMPLE 5-2 Verifying the inode Information
# sls -D ./mary/mary1
mary/mary1:
  mode: -rw-rw----  links:   1  owner: mary     group: sam
  length:        53  inode:          43
  offline;  archdone;
  copy 1: ---- Nov 17 12:35          8ae.1 xt 000000
  copy 2: ---- Nov 17 15:51       cd3.7f57 xt 000000
  access:      Nov 17 12:33  modification: Nov 17 12:33
  changed:     Nov 17 12:33  attributes:   Nov 17 15:49
  creation:    Nov 17 12:33  residence:    Nov 17 15:52

8. Use the mv(1) command to move the file to the desired location.


# cd mary
# mv mary1 /sam1/mary/


Restoring Files and Directories Without samfsdump(1M) Output

TABLE 5-2 lists the tasks for restoring various types of files when no samfsdump(1M) output is available.


TABLE 5-2 Tasks for Restoring Files When No sampfdump (1M) Output is Available

Type of File

Condition

Where Described

Regular file archived to removable media cartridges

An archiver log file exists with an entry for the file or you have output from the sls command with the -D option that lists the file.

Regular file archived to removable media cartridges

No archiver log file exists

Regular file archived to disk

An archiver log file exists with an entry for the file or you have output from the sls command with the -D option that lists the file.

Segmented file

An archiver log file exists with entries for the file.

Volume overflow file

An archiver log file exists with entries for the file.


When you have an archiver log with an entry or entries for a missing file, see the following sections for how to interpret the information in the archiver log file and how to determine which of the above procedures to use:

Note that if you restore files without samfsdump(1M) output, you recreate the .inodes file. In addition, you lose the content of the original .inodes file. If you had used chmod(1), chown(1), or any other commands to modify file attributes, those attributes are lost. The files are restored with their default attributes. This applies to all types of files (regular files, segmented files, and so on).


Information Needed to Restore a File

TABLE 5-3 shows the information needed for restoring a regular file.


TABLE 5-3 Information Needed for Restoring a Regular File

Definition

Field in Archiver Log Output

Field in Archive Copy Line in sls -D Output

Media type

4

5

Volume Serial Name (VSN)

5

6

Position[3]

7

4


If you can get the needed information about a regular file either from its archiver log entry or from output about the file from the sls(1) command with the -D option, you can restore the file with the request(1M) and star(1M) commands. As shown in the examples that follow, the request command is first used to create a file whose contents represent the contents of one or more pieces of removable media (which is sometimes referred to as a request file). The star command is then used to extract the file, as shown in To Restore a Regular File Using Information From an Archiver Log or sls Command Output.


Determining Whether a File Is a Regular File, a Segmented File, or a Volume Overflow File

This section shows how to determine from a missing file's archiver log file entries whether the file is a regular file, a segmented file, or a volume overflow file. You need this information to decide which of the restoration procedures to follow from Restoring Files and Directories Without samfsdump(1M) Output.

Regular File

Each regular file has a single entry in an archiver log. In field 12 of the archiver log entry a regular file is identified with an f. The following example shows a typical entry for a regular file in an archiver log:


A 96/01/05 10:55:56 mo v1 set_1.1 d2e.1 samfs2 770.11 2673 test/file3 f 0 0

Segmented File

A segmented file is a file that has the segment attribute set and a segment_size specified using the segment(1) command. When a file has the segment attribute set, it is archived and staged in segment-sized chunks. The length of the segment (segment_size) is shown in field 10 of the archiver log file in kilobytes.

For each segmented file, an archiver log has multiple entries. CODE EXAMPLE 5-3 shows three entries for segmented file seg/aaa. Field 12 has a S indicating that the file type is file segment.


CODE EXAMPLE 5-3 Archiver Log Entry for a Segmented File
A 2000/06/15 17:07:28 ib E00000 all.1 1276a.1 samfs4 14.5 10485760 seg/aaa/1 S 0 51
A 2000/06/15 17:07:29 ib E00000 all.1 1276a.5002 samfs4 15.5 10485760 seg/aaa/2 S 0 51
A 2000/06/15 17:07:29 ib E00000 all.1 1276a.a003 samfs4 16.5 184 seg/aaa/3 S 0 51

Volume Overflow File

A volume overflow file is one that is written on multiple volumes. For a volume overflow file, an archiver log has multiple entries, one for each section of the file. CODE EXAMPLE 5-4 shows two entries for the two sections of file big2d.


CODE EXAMPLE 5-4 Archiver Log Entry for a Volume Overflow File
A 2001/10/31 09:47:29 lt CFX600 arset1.1 3668e.1 samfs9 71950.15 2011823616 testdir1/big2d f 0 43
A 2001/10/31 09:47:29 lt CFX603 arset1.1 3844a.0 samfs9 71950.15 1209402048 testdir1/big2d f 1 41

The big2d file is identified as a volume overflow file because it has two entries, the f in field 12 indicates that the entry is for a regular file, and the 0 and the 1 in field 13 are section numbers. Field 5 shows that the file starts on VSN CFX600 and overflows to VSN CFX603.

Summary of Differences

TABLE 5-4 summarizes the defining characteristics of regular, segmented, and volume overflow files.


TABLE 5-4 Defining Characteristics of Regular, Segmented, and Volume Overflow Files

File Type

Definition

A file is a regular file if . . .

It has only a single entry

The file type in field 12 is f.

A file is a segmented file if . . .

It has multiple entries.

The VSN in field 5 is the same for each entry.

The file type in field 12 is S.

The section numbers in field 13 are the same for each entry.

A file is a volume overflow file if . . .

It has multiple entries.

The VSN in field 5 is different for each entry.

The file type in field 12 is f.

The section numbers in field 13 are different for each entry.



procedure icon  To Restore a Regular File Using Information From an Archiver Log or sls Command Output



Note - For the procedure to work, the SAM-QFS file system must be mounted.



1. Log in as, or switch user to, root.

2. Find the media type, the file's position, and the VSN.

a. If you have an archiver log, use cat(1M) or another command to search the archiver log file for an entry for the missing file.

CODE EXAMPLE 5-5 shows the sample entry for a file that is archived on a tape followed by a sample entry for a file archived on an optical disk.


CODE EXAMPLE 5-5 Using the cat (1) Command to Search the Archiver Log
# cat
...
A 96/06/04 10:55:56 lt DLT001 arset0.1 286.1324f samfs1 770.11 130543 tape_test/file4 0 0 0
A 96/01/05 10:55:56 mo v1 set_1.1 d2e.1 samfs2 770.11 2673 test/file3 0 0 0

If needed, see TABLE 5-3 for definitions of the fields in the archiver log file.

b. If you have output from the sls command with the -D option about the missing file, search that output.

CODE EXAMPLE 5-6 shows output from the sls(1) command with the -D option for file tape_test/file4.


CODE EXAMPLE 5-6 sls (1) Output using the -D Option
# sls -D /sam1/tape_test/file4
/sam1/tape_test/file4:
 mode: -rw-rw----  links:   1  owner: root      group: other 
 length:    130543
 offline;
 copy 1:   Jun  4 10:55       286.1324f lt DLT001
 access:   May 24 16:55  modification: May 24 16:38
 changed:  May 24 16:38  attributes:   Jun  4 10:55
 creation: May 24 16:38  residence:    Jun  4 10:55

c. Record the media type, the file's position, and the VSN to use as input to the request(1M) command in the next step.

3. Use the request(1M) command with the -p option using the position from the archiver log to position to the beginning of the tar(1) header for the file.

Use hexadecimal notation, prefacing the position number after the -p option with 0x.

The following example creates a request file with the contents of the archive containing the example file that is on tape:


# request -p 0x286 -m lt -v DLT001 /sam1/xxxx

The following example creates a request file with the contents of the example file that is on optical disk:


# request -p 0xd2e -m mo -v v1 /sam2/xxxx



Note - VSNs specified using request(1M) command must reside on a local automated library.



4. Use the star(1M) command to extract the file as shown in CODE EXAMPLE 5-7.



Note - The star(1M) command restores all the files from the archive file that you are pointing to with the request file.




CODE EXAMPLE 5-7 Using star (1M) to Restore Files
# cd /sam1
# star -xv -b 32 -f /sam1/xxxx
 
...
tape_test/file4
...
tar: directory checksum error
 
# cd /sam2
# star -xv -b 32 -f /sam2/xxxx
...
test/file3
...
tar: directory checksum error
# 



Note - You can ignore the directory checksum error.



If you labeled the tape with a block size other than the default (16 kilobytes), you would use the block size in bytes divided by 512 (in place of the value 32) for the star command's -b option. You can see the tape block size by mounting the tape and observing either the samu(1M) utility's t display, the samu utility's v display (type CTRL-i for detail lines), or the output of the dump_cat(1M) command.

5. Use the sls(1) command to verify that you have extracted the lost file.

CODE EXAMPLE 5-8 shows the sls -D output for the file on the optical disk.


CODE EXAMPLE 5-8 Using sls (1) to Verify the Extracted Files

# sls -D /sam2/test/file3

/sam2/test/file3:

mode: -rw-rw---- links: 1 owner: root group: other

length: 2673 admin id: 7 inode: 161.2

copy 1:---- May 1 15:41 286.1324f mo v1

access: May 1 16:50 modification: May 1 15:41

changed: May 1 15:40 attributes: May 1 15:44

creation: May 1 15:40 residence: May 1 16:50



Restoring a Regular File Without Information From an Archiver Log

If you do not have an archive log available with an entry for the file, you can use the procedure To Restore a Regular File Without Information From an Archiver Log.



Note - If the only resources available consist of a cartridge containing archive copies and a Solaris system without Sun StorEdge SAM-FS software installed, you can still restore the file by starting this procedure with Step 3.



You can perform the procedure To Restore a Regular File Without Information From an Archiver Log using either an automated library or a manually mounted, standalone drive, under the following conditions:

To determine which cartridge contains the missing file, you need to examine only those volumes that are assigned to the archive set for the file in question. You can use the -t option to tar or star repeatedly on each volume as described in the procedure To Restore a Regular File Without Information From an Archiver Log to find out which volume contains the archive copy. When you have found the archive copy of the file, you then use the -x option to tar or star to extract the file.


procedure icon  To Restore a Regular File Without Information From an Archiver Log

1. (Optional) Prevent the Sun StorEdge SAM-FS software from using the tape drive.



Note - If you are using a manually mounted, standalone drive, skip this step.



You can use either the samu(1M) command with the :unavail eq option, the samcmd(1M) command with the unavail eq option, the devicetool(1M) or the libmgr(1M) command. For the samu and samcmd commands, specify the equipment ordinal of the drive as eq. The Equipment Ordinal for each device is specified in the mcf(4) file.

The following screen example shows the use of the samcmd command with the unavail subcommand when the equipment ordinal is 51.


# samcmd unavail 51

2. (Optional) Use the samload(1M) command to load the desired volume into the drive.



Note - If you are using a manually mounted, standalone drive, skip this step.



For the command line options to use, see the samload(1) man page. The following screen example shows the use of the samload command to load the cartridge that is in slot 3 of library 50 into the drive with equipment ordinal 51


# samload 50:03 51

3. Use the mt(1M) command to rewind the tape.

The following example shows how to do this using the mt(1M) command. If your tape drive is not /dev/rmt/2, substitute the correct name in the following examples.


# mt -f /dev/rmt/2cbn rewind



Note - Because the device name used in these examples ends with the n (no rewind) option, each of the commands in the following steps examines the next file on the tape.



4. Use od(1M) or another command to examine the ANSI label on the cartridge, and find the line that starts with 0000240.

The first file on the cartridge is the ANSI label. In the following example, the information you are looking for appears on the line that starts with 0000240.


# od -c /dev/rmt/2cbn
0000000   V   O   L   1   X   X   X
0000020                                   S   A   M   -   F   S       1
0000040   .   0
0000060
0000100                                                               4
0000120   H   D   R   1
0000140                                               0   0   0   1   0
0000160   0   0   1   0   0   0   1   0   0       2   4   9   0   9
0000200                                                   S   A   M   -
0000220   F   S       1   .   0
0000240   H   D   R   2       1   6   3   8   4                   1
0000260                                                   2   0   g 031
0000300
*
0000360

5. Note the five characters that appear after H D R 2 on the line that starts 0000240.

The five characters that appear after H D R 2 on the line that starts with 0000240 are the five bottom digits of the block size, in decimal. In the previous screen example, the characters are 1 6 3 8 4.

6. Use the five bottom digits of the block size to determine the block size used on the media.

Locate the bottom five digits of the block size in the left column of TABLE 5-5. For the dd(1M) command, the block size is found in the second column. For both the star(1M) and tar(1) commands, the block size is specified in units of 512-byte blocks, which are shown in column 3.


TABLE 5-5 Block Sizes Corresponding to the Bottom Five Digits of Block Size in the ANSI Label

Bottom Five Digits of Block Size

Block Size for dd(1)

512-byte Blocks for tar(1) and star(1M)

16384

16 kilobytes

32 blocks

32768

32 kilobytes

64 blocks

65536

64 kilobytes

128 blocks

31072

128 kilobytes

256 blocks

62144

256 kilobytes

512 blocks

24288

512 kilobytes

1024 blocks

48576

1024 kilobytes

2048 blocks

97152

2048 kilobytes

4096 blocks




Note - In the following screen examples, all files are archived twice, so each file is inspected twice.



7. If the star(1M) command is available, enter it with the number of 512-byte blocks obtained in the previous two steps to find the file in the archive.

You can download the star command from a Sun StorEdge SAM-FS system onto any Solaris system. If you do not have access to the star command, you can use the dd(1M) command with the tar(1) command, as shown in Step 8.



Note - star files have an extended maximum file size of 1 Tbytes-1. tar and star files have compatible formats only at file sizes less than or equal to (less than or equal) 8Gbytes-1. At larger than (greater than or equal) 8Gbytes, the formats of star and tar files are not compatible. Therefore, you must use the star command to read archives larger than 8 Gbytes-1.



CODE EXAMPLE 5-9 shows the star command being used to examine the first tar file. The block size for both the star(1M) and tar(1) commands is specified in units of 512-byte blocks. (The number 32 used after -b in the example is the number of 512-byte blocks that corresponds to the number 16384 in the ANSI label in Step 4, from the table in Step 6.


CODE EXAMPLE 5-9 star (1M) Command for Examining First tar (1) File
# star -tv -b 32 -f /dev/rmt/2cbn
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test
6+1 records in
11+1 records out

CODE EXAMPLE 5-10 shows the same command examining the next tar(1) file.


CODE EXAMPLE 5-10 star (1M) Command for Examining Second tar (1) File
# star -tv -b 32 -f /dev/rmt/2cbn
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test
6+1 records in
11+1 records out

CODE EXAMPLE 5-11 shows two copies of another file being examined.


CODE EXAMPLE 5-11 star (1M) Command for Examining Additional tar (1) Files
# star -tv -b 32 -f /dev/rmt/2cbn
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test2
6+1 records in
11+1 records out
# star -tv -b 32 -f /dev/rmt/2cbn
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test2
6+1 records in
11+1 records out

CODE EXAMPLE 5-12 shows the end of the tape has been reached.


CODE EXAMPLE 5-12 star(1M) and mt(1M) Output Showing the End of the Tape
# star -tv -b 32 -f /dev/rmt/2cbn
0+0 records in
0+0 records out
tar: blocksize = 0
# mt -f /dev/rmt/2cbn status
Other tape drive:
 sense key(0x13)= EOT   residual= 0   retries= 0
 file no= 5   block no= 0

8. If the star(1M) command is not available, use the dd(1M) and tar(1) commands to examine the archives.

CODE EXAMPLE 5-13 shows the dd command being used to examine the first tar file. The value 16k used for the input block size (ibs=) is the number in the third column of the table in Step 6 that corresponds to the number 16384 in the ANSI label in Step 4.


CODE EXAMPLE 5-13 dd (1M) Command for Examining the First tar (1) File
# dd if=/dev/rmt/2cbn ibs=16k obs=10k conv=sync | tar tvf -
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test
6+1 records in
11+1 records out

CODE EXAMPLE 5-14 shows the same command examining the next tar(1) file.


CODE EXAMPLE 5-14 dd (1M) Command for Examining the Next tar (1) File
# dd if=/dev/rmt/2cbn ibs=16k obs=10k conv=sync | tar tvf -
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test
6+1 records in
11+1 records out

CODE EXAMPLE 5-15 shows the examination of two copies of another file.


CODE EXAMPLE 5-15 dd (1M) Command for Examining Additional tar (1) Files
# dd if=/dev/rmt/2cbn ibs=16k obs=10k conv=sync | tar tvf -
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test2
6+1 records in
11+1 records out
# dd if=/dev/rmt/2cbn ibs=16k obs=10k conv=sync | tar tvf -
-rw-rw----  0/1   102564 Sep  6 13:02 1996 test2
6+1 records in
11+1 records out

CODE EXAMPLE 5-16 shows that the end of the tape has been reached.


CODE EXAMPLE 5-16 dd (1M) and mt (1M) Output Showing the End of the Tape
# dd if=/dev/rmt/2cbn ibs=16k obs=10k conv=sync | tar tvf -
0+0 records in
0+0 records out
tar: blocksize = 0
# mt -f /dev/rmt/2cbn status
Other tape drive:
 sense key(0x13)= EOT   residual= 0   retries= 0
 file no= 5   block no= 0



Note - You might receive errors during this process. The following error indicates that the block size you selected does not match that of the tape:

read: not enough space

Correct the block size and try again.



9. When you find the missing file in an archive, use the -x option with either the star command alone or the dd command with the tar command to extract the files from that archive.

CODE EXAMPLE 5-17 shows these commands.



Note - You can ignore the dd: read error in the first line of output.




CODE EXAMPLE 5-17 Using the star (1M) command or the dd (1M) and tar (1) Commands
# dd if=/dev/samst/c0t1u0 bs=1k iseek=3374 of=/tmp/junk count=10
dd: read error: I/O error
8+0 records in
8+0 records out
# tar xvf /tmp/junk
 
# star -xv -f /tmp/junk
tar: blocksize = 1
-rw-rw---- 0/1 2673 May 1 15:41 1996 dir3/dir2/file0
-rw-rw---- 0/1 946 May  1 15:41 1996 dir3/dir1/file1
-rw-rw---- 0/1 468 May  1 15:41 1996 dir1/dir3/file0


Restoring a Segmented File Using Information From an Archiver Log

When a segmented file is archived or staged, it is archived and staged in chunks. For each segmented file, an archiver log has multiple entries.

If an archiver log file exists, you can search the archiver log for the multiple entries for the missing segmented file. (See To Set Up Archiver Logging, if needed.)

If you can find entries for a missing segmented file in an archiver log, you can use the file's position, segment size, VSN, and media type, to restore the file using the request(1M) and star(1M) commands. The procedure is described in To Restore a Segmented File Using Information From Archiver Log Entries.

If needed, see TABLE 5-3 for definitions of the fields in the archiver log file.

The segmented file named aaa is used in the examples in this section and in the procedure. CODE EXAMPLE 5-18 shows three entries for segmented file aaa in the archiver log file.


CODE EXAMPLE 5-18 Archiver Log File Showing Segmented File aaa
A 2000/06/15 17:07:28 ib E00000 all.1 1276a.1 samfs4 14.5 10485760 seg/aaa/1 S 0 51
A 2000/06/15 17:07:29 ib E00000 all.1 1276a.5002 samfs4 15.5 10485760 seg/aaa/2 S 0 51
A 2000/06/15 17:07:29 ib E00000 all.1 1276a.a003 samfs4 16.5 184 seg/aaa/3 S 0 51



Note - CODE EXAMPLE 5-18 assumes that all segments are in the same tape tar(1) file and that no segment is overflowed. If there are segments on more than one tar(1) file, use a separate request(1M) command for each tar(1) file position. If any segments are volume overflow files, use the procedure described in Restoring a Volume Overflow File Using Information From an Archiver Log for those segments.



TABLE 5-6 provides a place to record the information used when restoring a segmented file.


TABLE 5-6 Archiver Log Entry Information Needed for Restoring a Segmented File

Field

Definition

Notes

4

Media type

 

5

VSN

 

7

Position

 

12

File type

The S in field 12 indicates that the entry is for a segment of a segmented file.

11

File name

In the file name field of the three example entries, the three segments of the file aaa are identified as seg/aaa/1, seg/aaa/2, and seg/aaa/3.

10

Length

For entries for file segments, the segment size (length) is shown. You specify the segment size of the first segment on the segment(1) command line to recover a segmented file.



procedure icon  To Restore a Segmented File Using Information From Archiver Log Entries



Note - Free space must be available in the file system equal to two times the size of the file to be recovered.



1. Find the archiver log entries for the segmented file by the file system name (from field 8) and file name (from field 11).

CODE EXAMPLE 5-19 shows entries for segmented file file2 in the archiver.log file.

 


CODE EXAMPLE 5-19 Example Archiver Log File
A 2002/11/19 14:01:47 ib E00000 all.1 1276a.1 samfs4 14.5 10485760 seg/aaa/1 S 0 51
A 2002/11/19 14:04:11 ib E00000 all.1 1276a.5002 samfs4 15.5 10485760 seg/aaa/2 S 0 51
A 2002/11/19 14:06:24 ib E00000 all.1 1933a.1 samfs4 16.5 184 seg/aaa/3 S 0 51

CODE EXAMPLE 5-19 shows the archiver log file for file segments in file system qfs1. Each segment has its own entry and file name: seg/aaa/1, seg/aaa/2, seg/aaa/3, and so on.

If needed, see TABLE 5-3 for definitions of the fields in the archiver log file.

2. Note the contents of several fields in the archiver log.

Information from the archiver log needs to be used as input to the request(1M) command in Step 3 and to the segment(1) command in Step 9. The information needed is contained in the following fields:

The first line in the previous screen example provides the following information:

3. Enter the request(1M) command to create a removable media file that points to the segments.

Supply the following information as arguments to the request(1M) command:

The following command uses the values from the example lines in Step 1:


# request -m ib -p 0x1276a -v E00000 /sam3/rmfile

The preceding command retrieves the first two segments.



Note - VSNs specified using request(1M) command must reside on a local automated library.



4. Enter the star(1M) command, as shown in CODE EXAMPLE 5-20.

Use the name of the file created in the previous step to read the segments from tape onto the disk.


CODE EXAMPLE 5-20 Read the Segments from Tape to Disk
# star xvbf 512 /sam3/rmfile
seg/aaa/1
seg/aaa/2

5. Repeat Step 2, Step 3, and Step 4 for each segment or group of segments that is located at a unique position (even if they are on the same VSN).

There might be more than one segment at a position. You might need to issue this step, Step 3, and Step 4 as a sequence more than once.

If there are segments on different VSNs, make sure you specify the correct media type and VSN for each.

The following commands complete the command sequence that is needed to retrieve the three file segments described in CODE EXAMPLE 5-19:


CODE EXAMPLE 5-21 Entering Additional Commands
# request -m ib -p 0x1933a -v E00000 /sam3/rmfile
# star xvbf 512 /sam3/rmfile

The commands in CODE EXAMPLE 5-21 are needed because the third segment is at a different position from the first two segments. If there are file segments at more than one location, you must enter request(1M) and star(M) commands to retrieve all the segments. You can dispense with other files that might be retrieved in the same tarball.

6. Use the cd(1) command to change into the directory where the segmented files reside.

CODE EXAMPLE 5-22 shows segmented files 1, 2, and 3 in the seg/aaa directory.


CODE EXAMPLE 5-22 Change to the Directory Where the Segmented Files Reside
# cd seg
# pwd
/sam3/seg
# ls -l
total 8
drwxrwx---   2 root     other       4096 Jun 15 17:10 aaa/
# ls -l aaa
total 40968
-rw-rw----   1 root     other    10485760 Jun 15 17:06 1
-rw-rw----   1 root     other    10485760 Jun 15 17:06 2
-rw-rw----   1 root     other        184 Jun 15 17:07 3
# pwd
/sam3/seg
# cd aaa
# pwd
/sam3/seg/aaa

7. Use the ls(1) and sort(1) commands to list and sort the numbered files in numerical order, and use the cat(1M) command to join the files.

The temporary file created in this step is not segmented.


# ls | sort -n | xargs cat > ../bbb

8. Use the cd(1) command to change to the directory above where the numbered files reside, and then use the rm(1) command to remove the numbered files.

CODE EXAMPLE 5-23 shows this.


CODE EXAMPLE 5-23 Change to the Directory Above the Numbered Files
# cd ..
# pwd
/sam3/seg
# ls -l
total 41000
drwxrwx---   2 root     other       4096 Jun 15 17:10 aaa/
-rw-rw----   1 root     other    20971704 Jun 15 17:11 bbb
# ls -l aaa
total 40968
-rw-rw----   1 root     other    10485760 Jun 15 17:06 1
-rw-rw----   1 root     other    10485760 Jun 15 17:06 2
-rw-rw----   1 root     other        184 Jun 15 17:07 3
# rm -rf aaa

9. Enter the touch(1M) command to create an empty file.


# touch aaa

10. Use the segment(1) command to set the segment attribute on the file created in Step 9.

Enter the segment command with the -l option following by the segment length in megabytes followed by m followed by the filename of the empty file created in the previous step.

Convert the segment length (from field 10 of the archiver log file entry) to megabytes by dividing 1048576. For example, the segment length in the archiver log entry example in Step 2 is 10485760. Dividing the segment length by 1048576 gives 10 megabytes, which is entered as -l 10m in the following screen example.


# segment -l 10m aaa

11. Copy the temporary file created in Step 7 into the empty file created in Step 9, and then remove the temporary file.

CODE EXAMPLE 5-24 shows this procedure.


CODE EXAMPLE 5-24 Copying the Temporary File and then Removing It
# cp bbb aaa
# rm bbb

12. Enter the sls(1) command with the -2K option to list the segments of the segmented file in two lines of output.

CODE EXAMPLE 5-25 shows this procedure.


CODE EXAMPLE 5-25 Using the sls -2K Command
# sls -2K aaa
-rw-rw----   1 root     other     20971704 Jun 15 17:12 aaa
---------- ----- sI {3,0,0,0}
-rw-rw----   1 root     other     10485760 Jun 15 17:12 aaa/1
---------- ----- sS
-rw-rw----   1 root     other     10485760 Jun 15 17:12 aaa/2
---------- ----- sS
-rw-rw----   1 root     other          184 Jun 15 17:12 aaa/3
---------- ----- sS


Restoring a Volume Overflow File Using Information From an Archiver Log

A volume overflow file is a file that is written on multiple volumes. If an archiver log file exists, you can search the archiver log for entries for the missing file. (See To Set Up Archiver Logging, if needed.) If you can find entries for a missing volume overflow file in an archiver log, you can use the file's position, segment size, VSN, and media type, to restore and reassemble the file using the request(1M), star(1M), dd(1M), and cat(1) commands. The procedure is described in To Restore a Volume Overflow File Using Information From an Archiver Log.

If needed, see TABLE 5-3 for definitions of the fields in the archiver log file.

The volume overflow file named file3 is used in this section and in the procedure. CODE EXAMPLE 5-26 shows two entries for the two sections of file file3 in the archiver.log file:


CODE EXAMPLE 5-26 Archiver Log File Entries
A 2004/08/23 10:28:51 sg 700036 ReleasePercent.1 12d55.1 qfs2 11731.1 89128448 ReleasePercent/huge2/dir24/file3 f 0 210
A 2004/08/23 10:28:51 sg 700034 ReleasePercent.1 15f9e.0 qfs2 11731.1 525271552 ReleasePercent/huge2/dir24/file3 f 1 220

The file is identified as a volume overflow file with two sections because the f in the third-to-last field indicates that the entry is for a regular file, and the 0 and the 1 in the second-to-last fields are section numbers. The fifth field shows that the file starts on VSN 700036 and overflows to information about 700034.

The following procedure assumes that free space is available in the file system equal to two times the recovered file.


procedure icon  To Restore a Volume Overflow File Using Information From an Archiver Log



Note - Free space must be available in the file system equal to two times the size of the file to be recovered.



1. Use vi(1M) or another command to examine the archiver log file that contains an entry for the file you are trying to recover.

The archiver log file for file3 was shown previously in CODE EXAMPLE 5-26.

2. Use the request(1M) command to create a removable media file that points to each section.

CODE EXAMPLE 5-27 shows the request(1M) options to use.


CODE EXAMPLE 5-27 Using request (1M) Commands
# request -p 0x12d55 -m sg -v 700036 /samfs1/tp1
# request -p 0x15f9e -m sg -v 700032 /samfs1/tp2

3. Use the cd(1M) and dd(1M) commands to recover the sections.

CODE EXAMPLE 5-28 shows that a block size of 256 kilobytes is assumed for both tapes.


CODE EXAMPLE 5-28 Using the cd (1) and dd (1M) Commands
# cd /qfs2
# dd  if=/samfs1/tp1 of=file3.0 ibs=256k
340+0 records in
174080+0 records out
# dd  if=/samfs1/tp2 of=file3.1 ibs=256k
2004+0 records in
1026048+0 records out

Repeat the dd(1M) command for each remaining section.

4. Use the ls(1M) command to examine the output and ensure that all pieces of the file are on the disk.

CODE EXAMPLE 5-29 shows an example of this.


CODE EXAMPLE 5-29 Using the ls (1) Command to Examine Output
# ls -l file3.*
-rw-r--r--   1 root     other   89128960  Aug 31 12:07 file3.0
-rw-r--r--   1 root     other   525336576 Aug 31 12:14 file3.1

5. Use the cat(1M) and star(1M) commands to reassemble the files.

CODE EXAMPLE 5-30 uses the cat(1) and star(1) commands to reassemble the files.


CODE EXAMPLE 5-30 Reassembling the Files
# cat file3.0 file3.1 > file3.2
# ls -l file3.*
-rw-r--r--   1 root     other    89128960  Aug 31 12:07 file3.0
-rw-r--r--   1 root     other    525336576 Aug 31 12:14 file3.1
-rw-r--r--   1 root     other    614465536 Aug 31 12:21 file3.2
# star xvbf 256 file3.2
ReleasePercent/huge2/dir24/file3
# sls -D ReleasePercent/huge2/dir24/file3
ReleasePercent/huge2/dir24/file3:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length: 614400000  admin id:      0  inode:    12481.1
  access:      Aug 31 12:40  modification: Aug 20 14:28
  changed:     Aug 31 12:43  attributes:   Aug 31 12:40
  creation:    Aug 31 12:40  residence:    Aug 31 12:40


Restoring Files Archived to Disk

The following sections describe how to restore files archived to disk. The sections are as follows:

The examples in these procedures uses six archived files. Three of these files use long path names (filex, filey, filez), which result in extended tar(1) file headers. These are included just for completeness. No extra steps are required on behalf of the user for disaster recovery purposes of files with long path names.

Each of the sample files has four archive copies, as follows:


procedure icon  To Gather Information for a Disk Archive Restoration

The following information is needed before you can restore any files that have been archived to disk:

You must have either the saved sls(1) output or the archiver log files that include the files you want to restore.

1. Find the disk volume name and the path to the disk archive tar(1) file that contains the archived file.

You can use either the sls(1) command with the -D option or the archiver log file entry. The examples in this step show both.

Method 1 - Using sls(1)

You can use this method if you have sls(1) output for the files you want to restore.

CODE EXAMPLE 5-31 shows output from the sls(1) command. Examine the lines that correspond to the disk archive copies. These lines show a media type of dk in the fifth field. The second-to-the-last field in these lines shows the disk volume name as defined in diskvols.conf(4). The last field shows the path to the disk archive tar(1) file.

In the output for CODE EXAMPLE 5-31, both the commands you type in and the information you are looking for are in bold text.


CODE EXAMPLE 5-31 Sample sls (1) Output for a File Archived to Disk
# cd /shareqfs2/testdir4
# sls -D filea fileb filec
filea:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120235.783
  archdone;
  copy 1: ---- Nov  3 14:46     81366.1    dk DISK_01 d8/d19/f102
  copy 2: ---- Nov  3 14:54     2ec7e.209  dk DISK_02 d2/d236/f126
  copy 3: ---- Nov  3 14:58        bf.209  dk DISK_03 f191
  copy 4: ---- Nov  3 15:05      ea7a.209  lt 000064
  access:      Nov  3 14:35  modification: Nov  3 14:35
  changed:     Nov  3 14:35  attributes:   Nov  3 14:35
  creation:    Nov  3 14:35  residence:    Nov  3 14:35
fileb:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120300.783
  archdone;
  copy 1: ---- Nov  3 14:46     81366.105  dk DISK_01 d8/d19/f102
  copy 2: ---- Nov  3 14:54     2ec7e.411  dk DISK_02 d2/d236/f126
  copy 3: ---- Nov  3 14:58        bf.411  dk DISK_03 f191
  copy 4: ---- Nov  3 15:05      ea7a.411  lt 000064
  access:      Nov  3 14:35  modification: Nov  3 14:35
  changed:     Nov  3 14:35  attributes:   Nov  3 14:35
  creation:    Nov  3 14:35  residence:    Nov  3 14:35
filec:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120243.783
  archdone;
  copy 1: ---- Nov  3 14:46     81366.83   dk DISK_01 d8/d19/f102
  copy 2: ---- Nov  3 14:54     2ec7e.38f  dk DISK_02 d2/d236/f126
  copy 3: ---- Nov  3 14:58        bf.38f  dk DISK_03 f191
  copy 4: ---- Nov  3 15:05      ea7a.38f  lt 000064
  access:      Nov  3 14:35  modification: Nov  3 14:35
  changed:     Nov  3 14:35  attributes:   Nov  3 14:35
  creation:    Nov  3 14:35  residence:    Nov  3 14:35
# cd /shareqfs2/testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0
001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001
# sls -D filex filey filez
filex:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:    131420  admin id:      0  inode:   120239.783
  archdone;
  copy 1: ---- Nov  3 14:50     81367.20b  dk DISK_01 d8/d19/f103
  copy 2: ---- Nov  3 14:54     2ec7e.28d  dk DISK_02 d2/d236/f126
  copy 3: ---- Nov  3 14:58        bf.28d  dk DISK_03 f191
  copy 4: ---- Nov  3 15:05      ea7a.28d  lt 000064
  access:      Nov  3 14:36  modification: Nov  3 14:36
  changed:     Nov  3 14:36  attributes:   Nov  3 14:36
  creation:    Nov  3 14:36  residence:    Nov  3 14:36
filey:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:    131420  admin id:      0  inode:   120232.783
  archdone;
  copy 1: ---- Nov  3 14:50     81367.107  dk DISK_01 d8/d19/f103
  copy 2: ---- Nov  3 14:54     2ec7e.107  dk DISK_02 d2/d236/f126
  copy 3: ---- Nov  3 14:58        bf.107  dk DISK_03 f191
  copy 4: ---- Nov  3 15:05      ea7a.107  lt 000064
  access:      Nov  3 14:36  modification: Nov  3 14:36
  changed:     Nov  3 14:36  attributes:   Nov  3 14:36
  creation:    Nov  3 14:36  residence:    Nov  3 14:36
filez:
  mode: -rw-r--r--  links:   1  owner: root      group: other
  length:    131420  admin id:      0  inode:   120228.783
  archdone;
  copy 1: ---- Nov  3 14:50     81367.3    dk DISK_01 d8/d19/f103
  copy 2: ---- Nov  3 14:54     2ec7e.3    dk DISK_02 d2/d236/f126
  copy 3: ---- Nov  3 14:58        bf.3    dk DISK_03 f191
  copy 4: ---- Nov  3 15:05      ea7a.3    lt 000064
  access:      Nov  3 14:36  modification: Nov  3 14:36
  changed:     Nov  3 14:36  attributes:   Nov  3 14:36
  creation:    Nov  3 14:36  residence:    Nov  3 14:36

Method 2 - Using the Archiver Log File

Use this method if you have an archiver log file that includes the files you want to restore.

CODE EXAMPLE 5-32 shows archiver log example output. Examine the lines corresponding to the disk archive copies. These lines show a media type of dk in the fourth field. The fifth field in these lines shows the disk volume name as defined in diskvols.conf(4), and it shows the path to the disk archive tar(1) file. These are joined by a slash (/) character.

In the output for CODE EXAMPLE 5-32, the information you are looking for is in bold text.


CODE EXAMPLE 5-32 Archiver Log File Output for a File Archived to Disk
A 2003/11/03 14:46:35 dk DISK_01/d8/d19/f102 arset4.1 81366.1 shareqfs2 120235.783 65732 testdir4/filea f 0 0
A 2003/11/03 14:46:35 dk DISK_01/d8/d19/f102 arset4.1 81366.83 shareqfs2 120243.783 65732 testdir4/filec f 0 0
A 2003/11/03 14:46:35 dk DISK_01/d8/d19/f102 arset4.1 81366.105 shareqfs2 120300.783 65732 testdir4/fileb f 0 0
A 2003/11/03 14:50:35 dk DISK_01/d8/d19/f103 arset4.1 81367.3 shareqfs2 120228.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filez f 0 0
A 2003/11/03 14:50:35 dk DISK_01/d8/d19/f103 arset4.1 81367.107 shareqfs2 120232.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filey f 0 0
A 2003/11/03 14:50:35 dk DISK_01/d8/d19/f103 arset4.1 81367.20b shareqfs2 120239.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filex f 0 0
A 2003/11/03 14:54:35 dk DISK_02/d2/d236/f126 arset4.2 2ec7e.3 shareqfs2 120228.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filez f 0 0
A 2003/11/03 14:54:35 dk DISK_02/d2/d236/f126 arset4.2 2ec7e.107 shareqfs2 120232.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filey f 0 0
A 2003/11/03 14:54:35 dk DISK_02/d2/d236/f126 arset4.2 2ec7e.209 shareqfs2 120235.783 65732 testdir4/filea f 0 0
A 2003/11/03 14:54:35 dk DISK_02/d2/d236/f126 arset4.2 2ec7e.28d shareqfs2 120239.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filex f 0 0
A 2003/11/03 14:54:35 dk DISK_02/d2/d236/f126 arset4.2 2ec7e.38f shareqfs2 120243.783 65732 testdir4/filec f 0 0
A 2003/11/03 14:54:35 dk DISK_02/d2/d236/f126 arset4.2 2ec7e.411 shareqfs2 120300.783 65732 testdir4/fileb f 0 0
A 2003/11/03 14:58:35 dk DISK_03/f191 arset4.3 bf.3 shareqfs2 120228.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filez f 0 0
A 2003/11/03 14:58:35 dk DISK_03/f191 arset4.3 bf.107 shareqfs2 120232.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filey f 0 0
A 2003/11/03 14:58:35 dk DISK_03/f191 arset4.3 bf.209 shareqfs2 120235.783 65732 testdir4/filea f 0 0
A 2003/11/03 14:58:35 dk DISK_03/f191 arset4.3 bf.28d shareqfs2 120239.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filex f 0 0
A 2003/11/03 14:58:35 dk DISK_03/f191 arset4.3 bf.38f shareqfs2 120243.783 65732 testdir4/filec f 0 0
A 2003/11/03 14:58:35 dk DISK_03/f191 arset4.3 bf.411 shareqfs2 120300.783 65732 testdir4/fileb f 0 0
A 2003/11/03 15:05:33 lt 000064 arset4.4 ea7a.3 shareqfs2 120228.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filez f 0 42
A 2003/11/03 15:05:33 lt 000064 arset4.4 ea7a.107 shareqfs2 120232.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filey f 0 42
A 2003/11/03 15:05:33 lt 000064 arset4.4 ea7a.209 shareqfs2 120235.783 65732 testdir4/filea f 0 42
A 2003/11/03 15:05:33 lt 000064 arset4.4 ea7a.28d shareqfs2 120239.783 131420
testdir4/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/tstdir0001/filex f 0 42
A 2003/11/03 15:05:33 lt 000064 arset4.4 ea7a.38f shareqfs2 120243.783 65732 testdir4/filec f 0 42
A 2003/11/03 15:05:33 lt 000064 arset4.4 ea7a.411 shareqfs2 120300.783 65732 testdir4/fileb f 0 42

2. Use cat(1) or another command to examine the diskvols.conf(4) file and to find the path name defined for the disk volume name in diskvols.conf(4).

CODE EXAMPLE 5-33 shows the following three disk volumes defined for receiving disk archive copies:


procedure icon  To Restore a Single File From a Disk Archive tar(1) File

Use this procedure to restore a single file from a disk archive tar(1) file.

1. Use the procedure in To Gather Information for a Disk Archive Restoration to gather the information needed for this restoration.

2. Use the mkdir(1) command to create a directory in which to restore the files within a SAM-QFS file system.

3. Use the cd(1) command to change to the restoration directory.

4. Use the star(1M) command with its -tv options to list the content of the disk archive tar(1) file.

CODE EXAMPLE 5-34 shows the content of the disk archive tar(1) file associated with archive copy 1. The star(1M) command shown derives its input file name from two sources:



Note - This tar file could be on a remote server. If that is the case, this step requires that the remote authentication database be configured properly in order to access the disk archive tar(1) file on the remote server. For information on configuring the /.rhosts file, see the hosts.equiv(4) man page.



5. Verify that the file you wish to restore is listed in the output from Step 4.

If you find the file you are looking for, copy down the exact path name shown in the output for use in Step 6.

CODE EXAMPLE 5-34 shows lost file fileb residing in directory testdir4. Copy down testdir4/fileb for use in Step 6.

6. Use the star(1M) command with its -xv options to restore the file to the current directory.

The file name must match exactly the path name as it was listed in the output from Step 4 (CODE EXAMPLE 5-34).

CODE EXAMPLE 5-35 shows the star(1M) command retrieving file testdir4/fileb from disk archive tar(1) file /ufs2/disk_archive/01/d8/d19/f102.


CODE EXAMPLE 5-35 Using star (1M) to Retrieve the File
# star -xv -f /ufs2/disk_archive/01/d8/d19/f102 testdir4/fileb
testdir4/fileb

7. Use the sls(1) command with its -DR options to verify that you have extracted the proper file.

CODE EXAMPLE 5-36 shows sls(1) output.


CODE EXAMPLE 5-36 sls (1) Output Showing the Retrieved Files
# sls -DR
testdir4:
  mode: drwxr-xr-x  links:   2  owner: root      group: other   
  length:      4096  admin id:      0  inode:   120274.787
  access:      Nov  4 14:08  modification: Nov  4 14:08
  changed:     Nov  4 14:08  attributes:   Nov  4 14:08
  creation:    Nov  4 14:08  residence:    Nov  4 14:08
 
 
testdir4:
testdir4/fileb:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120293.785
  access:      Nov  4 14:08  modification: Nov  3 14:35
  changed:     Nov  4 14:08  attributes:   Nov  4 14:08
  creation:    Nov  4 14:08  residence:    Nov  4 14:08


procedure icon  To Restore Multiple Files From a Disk Archive tar(1) File

Use this procedure to restore multiple files from a disk archive tar(1) file.

1. Use the procedure in To Gather Information for a Disk Archive Restoration to gather the information needed for this restoration.

2. Use the mkdir(1) command to create a directory in which to restore the files within a SAM-QFS file system.

3. Use the cd(1) command to change to the restoration directory.

4. Use the star(1M) command with its -tv options to list the content of the disk archive tar(1) file.

CODE EXAMPLE 5-37 shows the content of the disk archive tar(1) file associated with archive copy 1. The star(1M) command shown derives its input file name from two sources:



Note - This tar file could be on a remote server. If that is the case, this step requires that the remote authentication database be configured properly in order to access the disk archive tar(1) file on the remote server. For information on configuring the /.rhosts file, see the hosts.equiv(4) man page.



5. Verify that the files you wish to restore are listed in the output from Step 4.

6. Use the star(1M) command with its -xv options to restore the entire content of the disk archive tar(1) file to the current directory.

CODE EXAMPLE 5-38 shows the star(1M) command retrieving all files from disk archive tar(1) file /ufs2/disk_archive/01/d8/d19/f102.


CODE EXAMPLE 5-38 Using star (1M) to Retrieve all the Files
# star -xv -f /ufs2/disk_archive/01/d8/d19/f102
testdir4/filea
testdir4/filec
testdir4/fileb

7. Use the sls(1) command with its -DR options to verify that you have extracted the proper files.

CODE EXAMPLE 5-39 shows sls(1) output.


CODE EXAMPLE 5-39 sls (1) Output Showing the Retrieved Files
# sls -DR
testdir4:
  mode: drwxr-xr-x  links:   2  owner: root      group: other   
  length:      4096  admin id:      0  inode:   120274.789
  access:      Nov  4 14:11  modification: Nov  4 14:11
  changed:     Nov  4 14:11  attributes:   Nov  4 14:11
  creation:    Nov  4 14:11  residence:    Nov  4 14:11
 
testdir4:
testdir4/filea:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120293.787
  access:      Nov  4 14:11  modification: Nov  3 14:35
  changed:     Nov  4 14:11  attributes:   Nov  4 14:11
  creation:    Nov  4 14:11  residence:    Nov  4 14:11
 
testdir4/fileb:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120281.783
  access:      Nov  4 14:11  modification: Nov  3 14:35
  changed:     Nov  4 14:11  attributes:   Nov  4 14:11
  creation:    Nov  4 14:11  residence:    Nov  4 14:11
 
testdir4/filec:
  mode: -rw-r--r--  links:   1  owner: root      group: other   
  length:     65732  admin id:      0  inode:   120280.783
  access:      Nov  4 14:11  modification: Nov  3 14:35
  changed:     Nov  4 14:11  attributes:   Nov  4 14:11
  creation:    Nov  4 14:11  residence:    Nov  4 14:11


Retrieving Unarchived Files From File Systems

Unarchived files that resided within a SAM-QFS file system might not be recoverable after a system outage. The following list contains information that might help you to retrieve unarchived files:

 


1 (TableFootnote) The same procedure is used for regular files, segmented files, volume overflow files, and directories.
2 (TableFootnote) TABLE 5-2 points to the different procedures to use depending on whether the file is a regular file, a segmented file, a volume overflow file, or a file archived to disk.
3 (TableFootnote) The position is the value on the left of the field with the format: position.offset.