System Administration Guide: Devices and File Systems
Previous Next

Backing Up a UFS Snapshot

You can create a full backup or an incremental backup of a 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. So, 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 procedure 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               : 1
    Block Device                  : /dev/fssnap/1
    Raw Device                    : /dev/rfssnap/1
    Mount point                   : /usr
    Device state                  : idle
    Backing store path            : /var/tmp/usr.snap0
    Backing store size            : 0 KB
    Maximum backing store size    : Unlimited
    Snapshot create time          : Thu Jul 01 15:17:33 2004
    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 has been backed up.

    For example:

    # ufsrestore tf /dev/rmt/0

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

Backing up a UFS snapshot incrementally means that only the files that have been modified since the last snapshot are backed up. Use the ufsdump command with the 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`

    In this example, the -o raw option is used 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 (such as the ufsdump command) that require the raw device instead.

  3. Verify that the snapshot has been 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 a file system from the backup, restore as if you had taken the backup directly from the original file system. Such a restore uses the ufsrestore command. For information on using the ufsrestore command to restore a file or file system, see Chapter 27, Restoring Files and File Systems (Tasks).

Previous Next