8.17. Creating a Snapshot

A snapshot is a special kind of logical volume that is actually a temporary, read-only copy of another volume. When a snapshot is created, it appears to contain a copy of all the data in the source volume, so that if the source is changed, the snapshot remains the same. In order to save on disk space, the snapshot really only stores data that has changed on the original logical volume since it was created. This makes it possible to create a snapshot copy of a 100 MB of volume even if the volume group has less than 100 MB of free space.

Snapshots are useful for quickly freezing a filesystem at some point so that it can be safely backed up. A snapshot can even act as a kind of backup itself, to which you can revert if something goes wrong with files on the original volume. The only down side is that a snapshot can only be safely created when the source logical volume is unmounted, as a mounted filesystem will not be in a valid state for copying.

To create a snapshot, follow these steps:

1.
In the Disk and Network Filesystems module, unmount the filesystem on the original logical volume, if necessary.

2.
Back in the Logical Volume Management module, click on the Create a new snapshot link in the same volume group as the original volume.

3.
On the snapshot creation form, enter a short name without spaces into the Volume name field—data_snap, for example.

4.
For the Volume size, enter the amount of disk space (in kB) that you want to allocate to this snapshot for storing differences made to the original logical volume after the snapshot was created. If the amount of space is too small and too many changes are made to the logical volume, I/O errors will start to occur when reading files in the snapshot filesystem.

5.
For the Snapshot of logical volume field, select the logical volume of which you want to make a copy.

6.
Click the Create button to create the snapshot and return to the main page. An icon for your new snapshot will appear among the other logical volumes in its volume group.

7.
In the Disk and Network Filesystems module, remount the filesystem on the original logical volume. You can mount the filesystem on the snapshot separately here as well.

Once created, a snapshot can be resized in the same way that you would resize a normal logical volume. This does not, however, resize the filesystem on the snapshot—instead, it changes the amount of space available for storing differences between the snapshot and original volume group. A snapshot can also be deleted, assuming the filesystem on it has been unmounted first. Any data in the snapshot will be lost, but since it is just a copy of another volume this isn't likely to matter much.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.248.1