Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX

Certification Objective 9.02—Performing Backup of a Mounted File System

Exam Objective 6.3: Backup a mounted file system by creating a UFS snapshot and performing a backup of the snapshot file.

As you already know, you cannot use the ufsdump command to make a backup of an active file system. However, if for some reason you do want to make a backup of an active file system, the first step is to take a snapshot of the system. A UFS snapshot is a temporary image of a UFS file system made for backup purpose. Solaris offers the fssnap command to create a read-only snapshot of a file system. The advantage of this command, of course, is that it can be used while the system is in multiuser mode and the file system is mounted: the disadvantage is that it may impede system performance when the snapshot is being taken.

The fssnap command creates a virtual device, and you can use the tar or cpio command to back up the snapshot to a storage device such as a tape. The syntax of the fssnap command for taking the snapshot of a file system is:

fssnap [-F <fileSystem>] [-V] -o backing-store=<destPath>, [<specificOptions>] <mountPoint>

Exam Watch

The fssnap command can be used when the system is in multiuser mode and the file system is mounted. This command does not back up data to an external device, but creates a virtual device on the disk that can later be backed up to an external device by using commands such as ufsdump, tar, or cpio.

The <mountPoint> specifies the directory name to which the file system (that is to be snapshot) is mounted. You must also specify the path for the backing-store file, <destPath>. The backing-store file(s) are used by the snapshot subsystem to save the old file system data before it is overwritten. The name specified by <destPath> must not match an existing file name. If <destPath> specifies the name of an existing directory, the backing-store file will be created in that directory and a file name will be provided automatically. You can use the abbreviation bs for the backing-store option.

The <specificOptions>, which are not required, are described here:

On the Job 

When you use the unlink option in creating a snapshot, the backing-store file will not be visible to you. That might make administration difficult. However, the file will be deleted automatically when the snapshot is deleted.

Remember that the backing-store files are the bitmap files that contain the copies of pre-snapshot data that has been modified since the snapshot was taken. Note the following about the backing-store files:

Now that you know how the fssnap command works, here are some practical scenarios and their solutions related to using this command.

SCENARIO & SOLUTION

How would you issue the fssnap command to take a snapshot of a UFS file system mounted to the directory /export/home? The backing-store files should be created in the /var/tmp directory.

fssnap -F ufs -o backing-store=/var /tmp/export/home

How will the command change if you want the backing-store files deleted automatically when the snapshot is deleted?

fssnap -F ufs -o backing-store=/var /tmp, unlink /export/home

How can you use the ufsdump command to back up the file system /export/home without unmounting it?

ufsdump 0uf /dev/rmt/0 'fssnap -F ufs -o backing-stores=/var/tmp, raw /export/home'

You make backups of file systems so that they can be restored to recover lost data in case of a disk failure or a disaster such as fire.

Категории