Description: a snapshot is a copy of the state of a logical volume at a particular point. It’s created almost immediately, so it’s very useful to backup large logical volumes. In this example, I’m going to create a snapshot of a logical volume called logical_volume1 beloging to the volume group volume_group1.
Steps:
- Check the size of the logical volume (LV Size):
lvdisplay /dev/volume_group1/logical_volume1
--- Logical volume ---
LV Name /dev/volume_group1/logical_volume1
VG Name volume_group1
LV UUID AxihqP-Yt8l-5scY-bXNG-Bn5D-K3ms-X7v1Ys
LV Write Access read/write
LV Status available
# open 1
LV Size 200,00 GB
Current LE 6400
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5Usually, snapshots are smaller than the original logical volume, but I recommend to use at least the same space.
- Create the snapshot:
lvcreate -L200G -s -n backup_logical_volume1 /dev/volume_group1/logical_volume1
The -s param tells lvcreate to create a snapshot instead of a normal logical volume.
