Solaris 8 System Administration Supplement

Creating UFS Snapshots

When you use the fssnap command to create a file-system snapshot, observe how much disk space the backing-store file consumes. The backing-store file uses no space, and then it grows quickly, especially on heavily used systems. Make sure the backing-store file has enough space to grow, or limit its size with the -o maxsize=n [k,m,g] option, where n [k,m,g] is the maximum size of the backing-store file.


Caution – Caution –

If the backing-store file runs out of space, the snapshot might delete itself, which causes the backup to fail. Check the /var/adm/messages file for possible snapshot errors.


How to Create a UFS Snapshot

  1. Become superuser.

  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 /file-system/backing-store-file
    
  4. Create the file-system snapshot.


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

Examples—Creating a UFS Snapshot

The following example creates a snapshot of the /usr file system. The backing-store file is /scratch/usr.back.file, and the virtual device is /dev/fssnap/1.


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

The following example limits the backing-store file to 500 Mbytes.


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

How to Display UFS Snapshot Information

You can display the current snapshots on the system by using the fssnap -i option. If you specify a file system, you see detailed information about that snapshot. If you don't specify a file system, you see information about all of the current file-system snapshots and their corresponding virtual devices.

  1. Become superuser.

  2. List current snapshots.


    # fssnap -i
       0    /
       1    /usr

    To display detailed information about a specific snapshot, use the following:


    # 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