![]() |
![]() |
| |||||||||||||||||||||||||||||||||||||||||||||
Chapter 48Using UFS Snapshots (Tasks)This chapter describes how to create and back up UFS snapshots. For information on the procedures associated with creating UFS snapshots, see Using UFS Snapshots (Task Map). For overview information about performing backups, see Chapter 46, Backing Up and Restoring File Systems (Overview). Using UFS Snapshots (Task Map)
UFS Snapshots OverviewThe Solaris release includes the fssnap command for backing up file systems while the file system is mounted. You can use the fssnap command to create a read-only snapshot of a file system. A snapshot is a file system's temporary image that is intended for backup operations. When the fssnap command is run, it creates a virtual device and a backing-store file. You can back up the virtual device, which looks and acts like a real device, with any of the existing Solaris backup commands. The backing-store file is a bitmap file that contains copies of presnapshot data that has been modified since the snapshot was taken. Why Use UFS Snapshots?The UFS snapshots feature enables you to keep the file system mounted and the system in multiuser mode during backups. Previously, you were advised to bring the system to single-user mode to keep the file system inactive when you used the ufsdump command to perform backups. You can also use additional Solaris backup commands, such as tar and cpio, to back up a UFS snapshot for more reliable backups. The fssnap command gives administrators of nonenterprise-level systems the power of enterprise-level tools, such as Sun StorEdge Instant Image, without the large storage demands. The UFS snapshots feature is similar to the Instant Image product. Although UFS snapshots can make copies of large file systems, Instant Image is better suited for enterprise-level systems. UFS snapshots is better suited for smaller systems. Instant Image allocates space equal to the size of the entire file system that is being captured. However, the backing-store file that is created by UFS snapshots occupies only as much disk space as needed. This table describes specific differences between UFS snapshots and Instant Image.
UFS Snapshots Performance IssuesWhen the UFS snapshot is first created, users of the file system might notice a slight pause. The length of the pause increases with the size of the file system to be captured. While the snapshot is active, users of the file system might notice a slight performance impact when the file system is written to, but they see no impact when the file system is read. Creating and Deleting UFS SnapshotsWhen you use the fssnap command to create a UFS 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 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.
For more information, see the fssnap_ufs(1M) man page.
|
# df -k |
Make sure that a backing-store file of the same name and location does not already exist.
# ls /backing-store-file |
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.
Verify that the snapshot has been created.
# /usr/lib/fs/ufs/fssnap -i /file-system |
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 /export/home /dev/fssnap/1 |
How to Display UFS Snapshot InformationYou 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 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.
Become superuser or assume an equivalent role.
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 : /usr Device state : idle Backing store path : /var/tmp/snapshot3 Backing store size : 256 KB Maximum backing store size : Unlimited Snapshot create time : Wed Oct 08 10:38:25 2003 Copy-on-write granularity : 32 KB Snapshot number : 1 Block Device : /dev/fssnap/1 Raw Device : /dev/rfssnap/1 Mount point : / Device state : idle Backing store path : /tmp/bs.home Backing store size : 448 KB Maximum backing store size : Unlimited Snapshot create time : Wed Oct 08 10:39:29 2003 Copy-on-write granularity : 32 KB |
Display detailed information about a specific snapshot:
For example:
# /usr/lib/fs/ufs/fssnap -i /usr Snapshot number : 0 Block Device : /dev/fssnap/0 Raw Device : /dev/rfssnap/0 Mount point : /usr Device state : idle Backing store path : /var/tmp/snapshot3 Backing store size : 256 KB Maximum backing store size : Unlimited Snapshot create time : Wed Oct 08 10:38:25 2003 Copy-on-write granularity : 32 KB |
Previous Contents Index Next ![]() |