Restoring from a Storage Checkpoint

Mountable data Storage Checkpoints on a consistent and undamaged file system can be used by backup and restore applications to restore either individual files or an entire file system. Restoration from Storage Checkpoints can also help recover incorrectly modified files, but typically cannot recover from hardware damage or other file system integrity problems.

Note:

For hardware or other integrity problems, Storage Checkpoints must be supplemented by backups from other media.

Files can be restored by copying the entire file from a mounted Storage Checkpoint back to the primary fileset. To restore an entire file system, you can designate a mountable data Storage Checkpoint as the primary fileset using the fsckpt_restore command.

See the fsckpt_restore(1M) manual page.

When using the fsckpt_restore command to restore a file system from a Storage Checkpoint, all changes made to that file system after that Storage Checkpoint's creation date are permanently lost. The only Storage Checkpoints and data preserved are those that were created at the same time, or before, the selected Storage Checkpoint's creation. The file system cannot be mounted at the time that fsckpt_restore is invoked.

Note:

Individual files can also be restored very efficiently by applications using the fsckpt_fbmap(3) library function to restore only modified portions of a files data.

You can restore from a Storage Checkpoint only to a file system that has disk layout Version 6 or later.

The following example restores a file, file1.txt, which resides in your home directory, from the Storage Checkpoint CKPT1 to the device /dev/vx/dsk/dg1/vol-01. The mount point for the device is /home.

To restore a file from a Storage Checkpoint

  1. Create the Storage Checkpoint CKPT1 of /home.
      $ fsckptadm create CKPT1 /home
  2. Mount Storage Checkpoint CKPT1 on the directory /home/checkpoints/mar_4.
      $ /opt/VRTS/bin/mount -o ckpt=CKPT1 /dev/vx/dsk/dg1/vol- \
      01:CKPT1 /home/checkpoints/mar_4
  3. Delete the file1.txt file from your home directory.
      $ cd /home/users/me
      $ rm file1.txt
  4. Go to the /home/checkpoints/mar_4/users/me directory, which contains the image of your home directory.
      $ cd /home/checkpoints/mar_4/users/me
      $ ls -l
      -rw-r--r--  1  me  staff  14910   Mar 4   17:09   file1.txt
  5. Copy the file file1.txt to your home directory.
      $ cp file1.txt /home/users/me
      $ cd /home/users/me
      $ ls -l
      -rw-r--r--   1 me  staff  14910   Mar 4  18:21   file1.txt

The following example restores a file system from the Storage Checkpoint CKPT3. The filesets listed before the restoration show an unnamed root fileset and six Storage Checkpoints.

To restore a file system from a Storage Checkpoint

  1. Run the fsckpt_restore command:
      # fsckpt_restore -l /dev/vx/dsk/dg1/vol2 
      /dev/vx/dsk/dg1/vol2:
      UNNAMED:
        ctime        = Thu 08 May 2004 06:28:26 PM PST
        mtime        = Thu 08 May 2004 06:28:26 PM PST
        flags        = largefiles, file system root
      CKPT6:
         ctime        = Thu 08 May 2004 06:28:35 PM PST
        mtime        = Thu 08 May 2004 06:28:35 PM PST
        flags        = largefiles
      CKPT5:
        ctime        = Thu 08 May 2004 06:28:34 PM PST
        mtime        = Thu 08 May 2004 06:28:34 PM PST
        flags        = largefiles, nomount
      CKPT4:
        ctime        = Thu 08 May 2004 06:28:33 PM PST
        mtime        = Thu 08 May 2004 06:28:33 PM PST
        flags        = largefiles
      CKPT3:
        ctime        = Thu 08 May 2004 06:28:36 PM PST
        mtime        = Thu 08 May 2004 06:28:36 PM PST
        flags        = largefiles
      CKPT2:
        ctime        = Thu 08 May 2004 06:28:30 PM PST
        mtime        = Thu 08 May 2004 06:28:30 PM PST
        flags        = largefiles
      CKPT1:
        ctime        = Thu 08 May 2004 06:28:29 PM PST
        mtime        = Thu 08 May 2004 06:28:29 PM PST
        flags        = nodata, largefiles
  2. In this example, select the Storage Checkpoint CKPT3 as the new root fileset:
      Select Storage Checkpoint for restore operation
       or <Control/D> (EOF) to exit
       or <Return> to list Storage Checkpoints: CKPT3
      CKPT3:
        ctime        = Thu 08 May 2004 06:28:31 PM PST
        mtime        = Thu 08 May 2004 06:28:36 PM PST
        flags        = largefiles
      UX:vxfs fsckpt_restore: WARNING: V-3-24640: Any file system
      changes or Storage Checkpoints made after
      Thu 08  May 2004 06:28:31 PM PST will be lost.
  3. Type y to restore the file system from CKPT3:
      Restore the file system from Storage Checkpoint CKPT3 ?
      (ynq) y
      (Yes)
      UX:vxfs fsckpt_restore: INFO: V-3-23760: File system
      restored from CKPT3

    If the filesets are listed at this point, it shows that the former UNNAMED root fileset and CKPT6, CKPT5, and CKPT4 were removed, and that CKPT3 is now the primary fileset. CKPT3 is now the fileset that will be mounted by default.

  4. Run the fsckpt_restore command:
      # fsckpt_restore -l /dev/vx/dsk/dg1/vol2
      /dev/vx/dsk/dg1/vol2:
      CKPT3:
        ctime        = Thu 08 May 2004 06:28:31 PM PST
        mtime        = Thu 08 May 2004 06:28:36 PM PST
        flags        = largefiles, file system root
      CKPT2:
        ctime        = Thu 08 May 2004 06:28:30 PM PST
        mtime        = Thu 08 May 2004 06:28:30 PM PST
        flags        = largefiles
      CKPT1:
        ctime        = Thu 08 May 2004 06:28:29 PM PST
        mtime        = Thu 08 May 2004 06:28:29 PM PST
        flags        = nodata, largefiles
      Select Storage Checkpoint for restore operation
       or <Control/D> (EOF) to exit
       or <Return> to list Storage Checkpoints: