Previous  |  Next  >  
Product: File System Guides   
Manual: File System 4.1 Administrator's Guide   

File System Restore From Storage Checkpoints

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   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 when fsckpt_restore is invoked.


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

Example of Restoring a File From a Storage Checkpoint

The following example restores a file, MyFile.txt, which resides in your home directory, from the Storage Checkpoint "CKPT1" to the device /dev/vx/dsk/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.
       $ fckptadm create CKPT1 /home
  2. Mount Storage Checkpoint CKPT1 on the directory /home/checkpoints/mar_4.
    $ mount -F vxfs -o ckpt=CKPT1 /dev/vx/dsk/dg1/vol-01:CKPT1 \
    /home/checkpoints/mar_4
  3. Delete the file MyFile.txt from your home directory.
       $ cd   /home/users/me
       $ rm MyFile.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    MyFile.txt
  5. Copy the file MyFile.txt to your home directory.
       $ cp MyFile.txt /home/users/me
       $ cd /home/users/me
       $ ls -l
       -rw-r--r--        1  me   staff     14910     Mar 4    18:21    MyFile.txt

Example of Restoring a File System From a Storage Checkpoint

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.

Click the thumbnail above to view full-sized image.

  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. Enter "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.

    Click the thumbnail above to view full-sized image.

  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:
 ^ Return to Top Previous  |  Next  >  
Product: File System Guides  
Manual: File System 4.1 Administrator's Guide  
VERITAS Software Corporation
www.veritas.com