Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
47.  Using UFS Snapshots (Tasks) Creating and Deleting UFS Snapshots Deleting a UFS Snapshot  Previous   Contents   Next 
   
 

How to Delete a UFS Snapshot

You can delete a snapshot either by rebooting the system or by using the fssnap -d command and specifying the path of the file system that contains the UFS snapshot.

  1. Become superuser or assume an equivalent role.

  2. Identify the snapshot to be deleted.

    # /usr/lib/fs/ufs/fssnap -i
  3. Delete the snapshot.

    # fssnap -d /file-system
    Deleted snapshot 1.
  4. (Optional) If you did not use the -o unlink option when you created the snapshot, you need to delete the backing-store file manually.

    # rm /file-system/backing-store-file

Example--Deleting a UFS Snapshot

The following example shows how to delete a snapshot and assumes that the unlink option was not used.

# fssnap -i
    0    /    1    /usr
# fssnap -d /usr
 Deleted snapshot 1.
# rm /scratch/usr.back.file

Backing Up a UFS Snapshot

You can create a full or incremental back up of UFS snapshot. You can use the standard Solaris backup commands to back up a UFS snapshot.

The virtual device that contains the UFS snapshot acts as a standard read-only device. This means you can back up the virtual device as if you were backing up a file system device.

If you are using the ufsdump command to back up a UFS snapshot, you can specify the snapshot name during the backup. See the following section for more information.

How to Create a Full Backup of a UFS Snapshot (ufsdump)

  1. Become superuser or assume an equivalent role.

  2. Identify the UFS snapshot to be backed up.

    # /usr/lib/fs/ufs/fssnap -i /file-system
     

    For example:

    # /usr/lib/fs/ufs/fssnap -i /usr
    Snapshot number               : 0
    Block Device                  : /dev/fssnap/0
    Raw Device                    : /dev/rfssnap/0
    Mount point                   : /usr
    Device state                  : idle
    Backing store path            : /var/tmp/back.store
    Backing store size            : 576 KB
    Maximum backing store size    : Unlimited
    Snapshot create time          : Wed Dec 12 09:39:37 2001
    Copy-on-write granularity     : 32 KB
  3. Back up the UFS snapshot.

    # ufsdump 0ucf /dev/rmt/0 /snapshot-name

    For example:

    # ufsdump 0ucf /dev/rmt/0 /dev/rfssnap/1 
  4. Verify that the snapshot is backed up.

    # ufsrestore tf /dev/rmt/0

How to Create an Incremental Backup of a UFS Snapshot (ufsdump)

If you want to back up a UFS snapshot incrementally, which means only the files that have been modified since the last snapshot are backed up, use the ufsdump command with the new N option. This option specifies the file system device name to be inserted into the /etc/dumpdates file for tracking incremental dumps.

The following ufsdump command specifies an embedded fssnap command to create an incremental backup of a file system.

  1. Become superuser or assume an equivalent role.

  2. Create an incremental backup of a UFS snapshot.

    For example:

    # ufsdump 1ufN /dev/rmt/0 /dev/rdsk/c0t1d0s0 `fssnap -F ufs -o raw,bs=
    /export/scratch,unlink /dev/rdsk/c0t1d0s0`

    The -o raw option is used in the example to display the name of the raw device instead of the block device. By using this option, you make it easier to embed the fssnap command in commands that require the raw device instead, such as the ufsdump command.

  3. Verify that the snapshot is backed up.

    # ufsrestore ta /dev/rmt/0

How to Back Up a UFS Snapshot (tar)

If you are using the tar command to back up the snapshot, mount the snapshot before backing it up.

  1. Become superuser or assume an equivalent role.

  2. Create a mount point for the snapshot.

    For example:

    # mkdir /backups/home.bkup
  3. Mount the snapshot.

    # mount -F ufs -o ro /dev/fssnap/1 /backups/home.bkup
  4. Change to the mounted snapshot directory.

    # cd /backups/home.bkup
  5. Back up the snapshot with the tar command.

# tar cvf /dev/rmt/0 .

Restoring Data From a UFS Snapshot Backup

The backup created from the virtual device is essentially just a backup of what the original file system looked like when the snapshot was taken. When you restore from the backup, restore as if you had taken the backup directly from the original file system, such as a backup that used the ufsrestore command. For information on using the ufsrestore command to restore a file or file system, see Chapter 48, Restoring Files and File Systems (Tasks).

 
 
 
  Previous   Contents   Next