How to backup SAM-FS file systems

In SAM-QFS file systems, the archiver command is used to copy both file data and metadata, other than the .inodes file, to archive media.

The samfsdump command enables you to back up metadata separately from the file system data. The samfsdump command creates metadata dumps (including the .inodes file) either for a complete file system or of a portion of a file system

samfsdump dumps the file control structure data, but NOT the .inodes file. The .inodes file is backed up separately using dd. Typically a cron job is used to do this automatically and will be done more frequently than the samfsdump as it takes less time.

samfsdump can back up 100,000 files a minute, because it's not backing up the full files, just control data. This means that restore time is also VERY fast. The only disadvantage is that no files will be resident in disk cache upon restore, so everything that needs to be accessed will have to be staged from archive. An alternative option is to use the -u option on samfsdump.

Be aware, however, that samfsdump will also NOT back up any files that have not been archived yet, so you will need to have a good archive of everything, or have those individual files backed up somewhere else.

WARNING Do not for any reason, back up SAM-FS file systems with NetBackup, EMC NetWorker, etc. These applications do not understand SAM-FS file system structure, so if you try to do it, you'll end up staging every file in the file system, you'll max out your disk cache, etc.

Using samfsdump with the -u option

The samfsdump command -u option causes unarchived file data to be interspersed with the metadata. Note the following about the use of the -u option:

  • A samfsdump command run with the -u option on a version 3.5 or 4.x SAM-QFS file system cannot restore the file system to an earlier version (3.3.x) file system of the same type because versions 3.5 and 4.x have new data structures. Dumps from a 4.x version of either file system type can be restored on a 3.5 version and vice versa.
  • A samfsdump dump taken using the -u option can be very large. The samfsdump command does not have any tape management or estimations such as those associated with ufsdump. When using the -u option, as when setting up any data protection procedures, you need to weigh the amount of dump storage space available against the risks of having unarchived data. For more information, see also the samfsdump and ufsdump man pages.

Creating a SAM Metadata Dump File

  1. Log in as root.
  2. Go to the mount point for the samfs type file system mount point or to the directory that you are dumping. For example:
    # cd /sam1
  3. Enter the samfsdump command to create a metadata dump file. The above shows a SAM-QFS file system metadata dump file being created on February 14, 2004, in a dumps subdirectory in dump file system /backups. The output of the ls command line shows that the date is assigned in yymmdd format as the dump file's name, 040214.
    # samfsdump -f /backups/`date +\%y\%m\%d`
    # ls /backups
    040214
    If you have a specific list of files that you would like to dump, you can use the -I include_file option. This only dumps the files and directories that are listed in the include_file. The include_file must have one relative or absolute path per line.

To restore files from a samfsdump file

In this example, we use the samfsrestore command to restore the lost file /sam1/foo/bar from a samfsdump metadata dump file called /backups/041126. In the example, a temporary restoration directory called restore is created in the /sam1 file system.

  1. Create the directory to which you want to restore the files within a SAM-QFS file system. For example:
    # cd /sam1
    # mkdir restore
  2. Use the archive command with the -r and -n options to prevent the archiver from archiving from this temporary directory location.
    # archive -r -n restore
  3. Change to the temporary restoration directory.
    # cd restore
  4. Use the samfsrestore 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 the following example:
    # samfsrestore -t -f /backups/041126
    ./lost+found
    ./delta
    ./echo
    ./foo
    ./alphaA
    ./bravoB
    ./charlieC
    ./delta
    ./delta/deltaD
    ./echo/echoe
    ./echo/echoE
    ./foo/bar
    ./foo/Bar
  5. Search the listing to verify that the lost file is in the dump file and copy down the exact path name
  6. Use the samfsrestore command with the -T and -f options to restore the file's inode information to the current directory.
    # samfsrestore -T -f /backups/041126 ./foo/bar
  7. Use the sls 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.
    # sls -D ./foo/bar
    foo/bar:
      mode: -rw-r--r--  links:  1  owner: mchurchi  group: staff
      length:       148  inode:         38
      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 command to move the file to the desired location.
    # cd foo
    # mv bar /sam1/foo/