How to Create LVM Snapshot Volume in Linux Easily

How to Create LVM Snapshot Volume in Linux Easily

This post will show you How to Create LVM Snapshot Volume in Linux Easily.

If you are interested in learning, Request you to go through the below recommended tutorial.

How to Create LVM Snapshot Volume in Linux Easily?

What is LVM Snapshots?

LVM Snapshots means Point-In-Time copies of logical volumes. However, snapshots are not true copies of the reference LVs. If the original LV has been changed after the creation of the snapshot then the original data in the snapshot will be copied into the snapshot first, Copy-on-Write

How to Create LVM Snapshot in Linux?

Snapshot volume can be as large or a small as you like but it must be large enough to hold all the changes that are likely to happen to the original volume during the lifetime of the snapshot. We suggest you to have the same size of Source volume while creating a snapshot.

For example, Lets say we have a volumegroup vg00, in which the source volume size is 4GB and we have free space of 4 GB Left in the volumegroup. So we can take snapshot of the source volume to the snapshot volume. If we dont have free space to create a snapshot volume, try to add a new disk to the existing volumegroup and create a snapshot volume.

[[email protected]:~]# vgdisplay
— Volume group —
VG Name               vg00
[…]
VG Size               7.98 GiB
PE Size               4.00 MiB
Total PE              2044
Alloc PE / Size       1022 / 3.99 GiB
  Free  PE / Size       1022 / 4.00 GiB                           ==> 4 GB Free space available
VG UUID               YTEj9f-9LCT-EOP5-JBEA-YHSz-c0R1-TMzVmy

We will use the free space 4GB to create a snapshot volume in Linux.

[[email protected]:~]# lvcreate -l100%FREE -s -n snap_vol1 /dev/vg00/vol1
Logical volume “snap_vol1” created

Where ‘-s’ to take a snapshot of the volume specified at the last in the command and ‘-n’ to specify the snapshot volume name.

To verify the data, mount the snapshot volume snap_vol1 on some folder and ensure the data available or not.

[[email protected]:~]# mount /dev/vg00/snap_vol1 /mnt

Your data will be available under /mnt, this can be used to restore the data from this snapshot volume anytime. And also you can remove the snapshot volume using lvremove command (lvremove /dev/vg00/snap_vol1) if you dont need this snapshot volume anymore.

Hope you have got an idea How to Create LVM Snapshot Volume in Linux Easily.

Related Content on Linux might be useful to you to improve your Linux Skills.

Keep practicing and have fun. Leave your comments if any.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.

create lvm snapshot, how to create lvm snapshot in linux, create snapshot volume, how to take snapshot of lvm, lvm snapshot how it works, lvm snapshot backup