Creating a Snapshot on LVM.

With Ubuntu 12.04 LTS all the software to play around with LVM should already be installed.

Create a snapshot from the shell prompt. We are going to make a

  • 5Gb snapshot
  • called lv_snap
  • of the real partition /dev/vg01/lv_home
  • which is 20Gb in size.
  • mount it at /mnt/snapshot

sudo  lvcreate -L5G -s -n lv_snap /dev/vg01/lv_home
Logical volume "lv_snap" created
sudo mkdir /mnt/snapshot 
sudo mount /dev/vg01/lv_snap /mnt/snapshot 
df -h /mnt/snapshot

Do your backups or whatever it was you wanted to do.

sudo umount /mnt/snapshot 
sudo lvremove /dev/vg01/lv_snap
Do you really want to remove active logical volume "lv_snap"? [y/n]: y
Logical volume "lv_snap" successfully removed 

All done 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *