Creating the snapshot

Creating the snapshot is very straightforward.  You need to have enough space in your Volume Group to store any changes that occur during the lifetime of the snapshot (while it exists).  A good rule of thumb for a reasonably quiet volume that will be mounted for a short time is 10% of the original volume size.  If you are not sure, and have the space, just use a size similar to the original volume size.

The syntax for the snapshot creation command is:

lvcreate -L<size> -s -n <snapshot name> <original volume>

where:

  • <size> is the desired size (you can use K, M, G, T etc as suffixes),
  • <snapshot name> is the name of the snapshot - it will appear as device /dev/<volume group>/<snapshot name>, and
  • <original volume> is the full device name of the original volume /dev/<volume group>/<volume>

For example:

lvcreate -L500M -s -n fs-snap /dev/vg/fs

The above command creates a 500MB snapshot called /dev/vg/fs-snap of the volume /dev/vg/fs.