InomHitta mer dokumentationSupportresurser som ingår | Ladda ner denna bok i PDF (1889 KB)
Chapter 47 Using 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 45, Backing Up and Restoring File Systems (Overview). Using UFS Snapshots (Task Map)
UFS Snapshots OverviewThe Solaris 9 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 bitmapped file that contains copies of pre-snapshot data that has been modified since the snapshot was taken. Why Use UFS Snapshots?UFS snapshots 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 like tar and cpio to back up a UFS snapshot for more reliable backups. The fssnap command gives administrators of non-enterprise-level systems the power of enterprise-level tools like Sun StorEdgeTM Instant Image without the large storage demands. UFS snapshots is similar to the Instant Image product. 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, and you can place a maximum size on the backing-store file. This table describes specific differences between UFS snapshots and Instant Image.
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. 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 will 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 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. 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. For more information, see fssnap_ufs(1M). How to Create a UFS Snapshot
Examples—Creating a UFS SnapshotThe following example shows how to create a snapshot of the /usr file system. The backing-store file is /scratch/usr.back.file, and the virtual device is /dev/fssnap/1.
The following example shows how to limit the backing-store file to 500 Mbytes.
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.
Deleting a UFS SnapshotWhen you create a UFS snapshot, you can specify that the backing-store file is unlinked, which means that the 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 will have to delete it manually. 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 remove it manually. How to Delete a UFS SnapshotYou can delete a snapshot either by rebooting the system or by using the fssnap -d command and specifying the path of the file system that contains the UFS snapshot.
Example—Deleting a UFS SnapshotThe following example shows how to delete a snapshot and assumes that the unlink option was not used.
Backing Up a UFS SnapshotYou can create a full or incremental back up of UFS snapshot. You can use the standard Solaris backup commands to back up a UFS snapshot. The virtual device that contains the UFS 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. How to Create a Full Backup of a UFS Snapshot (ufsdump)
How to Create an Incremental Backup of a UFS Snapshot (ufsdump)If you want to back up a UFS 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 backup of a file system.
How to Back Up a UFS Snapshot (tar)If you are using the tar command to back up the snapshot, mount the snapshot before backing it up.
Restoring Data From a UFS Snapshot BackupThe 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 a backup that used the ufsrestore command. For information on using the ufsrestore command to restore a file or file system, see Chapter 48, Restoring Files and File Systems (Tasks). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||