JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

About This Book

1.  Managing Removable Media (Overview)

2.  Managing Removable Media (Tasks)

3.  Accessing Removable Media (Tasks)

4.  Writing CDs and DVDs (Tasks)

5.  Managing Devices (Overview/Tasks)

6.  Dynamically Configuring Devices (Tasks)

7.  Using USB Devices (Overview)

8.  Using USB Devices (Tasks)

9.  Using InfiniBand Devices (Overview/Tasks)

10.  Managing Disks (Overview)

11.  Administering Disks (Tasks)

12.  SPARC: Setting Up Disks (Tasks)

13.  x86: Setting Up Disks (Tasks)

14.  Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)

15.  The format Utility (Reference)

16.  Managing File Systems (Overview)

17.  Creating and Mounting File Systems (Tasks)

18.  Using The CacheFS File System (Tasks)

19.  Configuring Additional Swap Space (Tasks)

20.  Checking UFS File System Consistency (Tasks)

21.  UFS File System (Reference)

22.  Backing Up and Restoring UFS File Systems (Overview)

23.  Backing Up UFS Files and File Systems (Tasks)

24.  Using UFS Snapshots (Tasks)

Using UFS Snapshots (Task Map)

UFS Snapshots Overview

Why Use UFS Snapshots?

UFS Snapshots Performance Issues

Creating and Deleting UFS Snapshots

Creating a Multiterabyte UFS Snapshot

How to Create a UFS Snapshot

How to Display UFS Snapshot Information

Deleting a UFS Snapshot

How to Delete a UFS Snapshot

Backing Up a UFS Snapshot

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

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

How to Back Up a UFS Snapshot (tar)

Restoring Data From a UFS Snapshot Backup

25.  Restoring UFS Files and File Systems (Tasks)

26.  UFS Backup and Restore Commands (Reference)

27.  Copying Files and File Systems (Tasks)

28.  Managing Tape Drives (Tasks)

Index

Creating and Deleting UFS Snapshots

When you use the fssnap command to create a UFS snapshot, observe how much disk space the backing-store file consumes. The backing-store file initially uses no space, and then it grows quickly, especially on heavily used systems. Make sure that the backing-store file has enough space to expand. 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.


You can also specify a directory for the backing-store path, which means a backing store file is created in the directory specified. For example, if /var/tmp is specified for the backing-store path, the following backing-store file is created.

/var/tmp/snapshot0

If you created one large root (/) file system instead of creating separate file systems for /export/home, /usr, and so on, you will be unable to create a snapshot of those separate file systems. For example, this system does not have a separate file system for /usr as indicated under the Mounted on column:

# df -k /usr
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0    3618177 2190002 1391994    62%    /

If you attempt to create a snapshot for the /usr file system, you will see a message similar to the following:

# fssnap -F ufs -o bs=/snaps/usr.back.file /usr
snapshot error: Invalid backing file path

This message indicates that you cannot have the backing store file on the same file system as the file system being snapped, which is the case for the /usr file system, in this example.

For more information, see the fssnap_ufs(1M) man page.

Creating a Multiterabyte UFS Snapshot

Creating a multiterabyte UFS snapshot is identical to creating a snapshot for a smaller UFS file system. The only difference is that multiple backing store files are created for each 512 GB of file system space.

Keep the following key points in mind when creating a snapshot for a file system that is larger than 512 GB:

For an example of creating a snapshot for a file system that is larger than 512 GB, see Example 24-2.

For more information, see fssnap_ufs(1M).

How 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 24-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 MB.

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

Example 24-2 Creating a Multiterabyte UFS Snapshot

The following example shows how to create a snapshot of a 1.6 TB 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          : Mon Jul 12 10:37:50 2010
Copy-on-write granularity     : 32 KB

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 file system snapshot. If you don't specify a file system, you see information about all of the current UFS snapshots and their corresponding virtual devices.


Note - Use the UFS file system-specific fssnap command to view the extended snapshot information as shown in the following examples.


  1. Become superuser or assume an equivalent role.
  2. List all current snapshots.

    For example:

    # /usr/lib/fs/ufs/fssnap -i
    Snapshot number               : 0
    Block Device                  : /dev/fssnap/0
    Raw Device                    : /dev/rfssnap/0
    Mount point                   : /export/home
    Device state                  : idle
    Backing store path            : /var/tmp/snapshot0
    Backing store size            : 0 KB
    Maximum backing store size    : Unlimited
    Snapshot create time          : Mon Jul 12 10:37:50 2010
    Copy-on-write granularity     : 32 KB
  3. Display detailed information about a specific snapshot.

    For example:

    # /usr/lib/fs/ufs/fssnap -i /export
    Snapshot number               : 1
    Block Device                  : /dev/fssnap/1
    Raw Device                    : /dev/rfssnap/1
    Mount point                   : /export
    Device state                  : idle
    Backing store path            : /var/tmp/snapshot1
    Backing store size            : 0 KB
    Maximum backing store size    : Unlimited
    Snapshot create time          : Mon Jul 12 10:37:50 2010
    Copy-on-write granularity     : 32 KB

Deleting a UFS Snapshot

When you create a UFS snapshot, you can specify that the backing-store file is unlinked. An unlinked backing-store file is removed after the snapshot is deleted. If you don't specify the -o unlink option when you create a UFS snapshot, you must manually delete the backing-store file.

The backing-store file occupies disk space until the snapshot is deleted, whether you use the -o unlink option to remove the backing-store file or you manually delete the file.

How to Delete a UFS Snapshot

You can delete a snapshot either by rebooting the system or by using the fssnap -d command. When you use this command, you must specify 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. If you did not use the -o unlink option when you created the snapshot, manually delete the backing-store file.
    # rm /file-system/backing-store-file

Example 24-3 Deleting a UFS Snapshot

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

# fssnap -i
    0    /export/home
    1    /export
   # fssnap -d /export
 Deleted snapshot 1.
# rm /var/tmp/snapshot1