As mentioned in Section 2, “Creating snapshot objects”, as data is copied from the original volume to the snapshot, the space available for the snapshot might fill up, causing the snapshot to be invalidated. This situation might cause your data backup to end prematurely, as the snapshot volume begins returning I/O errors after it is invalidated.
To solve this problem, EVMS now has the ability to expand the storage space for a snapshot object while the snapshot volume is active and mounted. This feature allows you to initially create a small snapshot object and expand the object as necessary as the space begins to fill up.
In order to expand the snapshot object, the underlying object must
be expandable.
Continuing the example from the previous sections, the object "snap" is
built on the LVM region lvm/Sample Container/Sample Region
.
When we refer to expanding the "snap" object, the region
lvm/Sample Container/Sample Region
is the
object that actually gets
expanded, and the object "snap" simply makes use of the new space on
that region.
Thus, to have expandable snapshots, you will usually want to build
your snapshot objects on top of LVM regions that have extra freespace
available in their LVM container. DriveLink objects and some disk
segments also work in certain situations.
One notable quirk about expanding snapshots is that the snapshot object and volume do not actually appear to expand after the operation is complete. Because the snapshot volume is supposed to be a frozen image of the original volume, the snapshot volume always has the same size as the original, even if the snapshot has been expanded. However, you can verify that the snapshot object is using the additional space by displaying the details for the snapshot object and comparing the percent-full field before and after the expand operation.
To create the snapshot using the GUI or Ncurses, follow these steps:
Select
→ → to see a list of EVMS feature objects.Select the volume
.Click or activate
.Select
. This object is the object that will actually be expanded.Click or activate
.Select the options for expanding the LVM region, including the amount of extra space to add to the region.
Click or activate
.Alternatively, you can perform the same steps using the context sensitive menus.
From the Volumes panel, right click (or press Enter on) .
Select
from the popup menu.Click or activate
.Select the region
. This is the object that will actually be expanded.Click or activate
.Select the options for expanding the LVM region, including the amount of extra space to add to the region.
Click or activate
.The CLI expands volumes by targeting the object to be expanded. The CLI automatically handles expanding the volume and other objects above the volume in the volume stock. As with a regular expand operation, the options are determined by the plug-in that owns the object being expanded.
Issue the following command to determine the expand options for the
region lvm/Sample Container/Sample Region
:
query:region,region="lvm/Sample Container/Sample Region",lo
The option to use for expanding this region is called "add_size." Issue the following command to expand the snapshot by 100 MB:
expand:"lvm/Sample Container/Sample Region", add_size=100MB