System Administration Guide: Devices and File Systems

ProcedureHow to Create a UFS Snapshot

  1. Become superuser or assume an equivalent role.

  2. Make sure that the file system has enough disk space for the backing-store file.


    # df -k 
    
  3. Make sure that a backing-store file of the same name and location does not already exist.


    # ls /backing-store-file
    
  4. Create the UFS snapshot.


    # fssnap -F ufs -o bs=/backing-store-file /file-system
    

    Note –

    The backing-store file must reside on a different file system than the file system that is being captured using UFS snapshots.


  5. Verify that the snapshot has been created.


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

Example 26–1 Creating a UFS Snapshot

The following example shows how to create a snapshot of the /usr file system. The backing-store file is /scratch/usr.back.file. The virtual device is /dev/fssnap/1.


# fssnap -F ufs -o bs=/scratch/usr.back.file /usr
/dev/fssnap/1

The following example shows how to limit the backing-store file to 500 Mbytes.


# fssnap -F ufs -o maxsize=500m,bs=/scratch/usr.back.file /usr 
/dev/fssnap/1


Example 26–2 Creating a Multiterabyte UFS Snapshot

The following example shows how to create a snapshot of a 1.6 Tbyte UFS file system.


# fssnap -F ufs -o bs=/var/tmp /datab
/dev/fssnap/2
# /usr/lib/fs/ufs/fssnap -i /datab
Snapshot number               : 2
Block Device                  : /dev/fssnap/2
Raw Device                    : /dev/rfssnap/2
Mount point                   : /datab
Device state                  : idle
Backing store path            : /var/tmp/snapshot3
Backing store size            : 0 KB
Maximum backing store size    : Unlimited
Snapshot create time          : Wed Jul 16 14:43:32 2008
Copy-on-write granularity     : 32 KB