Solaris 8 System Administration Supplement

Backing Up a UFS Snapshot

The virtual device that contains the file-system 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.

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


# mkdir /backups/home.bkup
# mount -F UFS -o ro /dev/fssnap/1 /backups/home.bkup
# cd /backups/home.bkup
# tar cvf /dev/rmt/0 .

For more information on how to back up a file system see "Backing Up Files and File Systems (Tasks)" in System Administration Guide, Volume 1.

How to Back Up a UFS Snapshot

  1. Become superuser.

  2. Identify the file-system snapshot to be backed up.


    # fssnap -i /file-system
     
    

    For example:


    # 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            : /scratch/usr.back.file
    Backing store size            : 480 KB
    Maximum backing store size    : Unlimited
    Snapshot create time          : Tue Aug 08 09:57:07 2000
    Copy-on-write granularity     : 32 KB
  3. Back up the file system snapshot.


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

    For example:


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


    # ufsrestore ta /dev/rmt/0
    

How to Create an Incremental Dump of a UFS Snapshot

If you want to create a file-system 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 dump of a file system.

  1. Become superuser.

  2. Create an incremental dump of a file system snapshot.


    # 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 the snapshot is backed up.


    # ufsrestore ta /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 one that used the ufsrestore command. For more information on restoring file systems see "Restoring Files and File Systems (Tasks)" in System Administration Guide, Volume 1.