Recording and restoring logical volume snapshots in LVM (part 3)

Source: Internet
Author: User

Recording and restoring logical volume snapshots in LVM (part 3)

The LVM snapshot is a copy of the lvm volume created by changing the space time. It only works in lvm and only occupies the space of the snapshot volume when the source logical volume changes. If the source volume changes to 1 GB, the snapshot volume also changes. Therefore, the best way to make effective use of space is to always make small changes. If snapshots consume up storage space, you can use lvextend to resize it. If we need to reduce the volume occupied by the snapshot, we can use lvreduce.

Recording snapshots in LVM

If any file is accidentally deleted after a snapshot is created, we do not need to worry because the snapshot contains the original file of the file we deleted. When creating a snapshot, it is very likely that the file already exists. Do not change the snapshot volume to keep it as it is used for fast recovery.

Snapshot cannot be used for backup options. Backup is the basic copy of some data, so we cannot use snapshots as a backup option.

Pre-reading
  • Use LVM to create elastic disk storage-Part 1
  • Expanding/downgrading LVM in Linux (Part 2)
  • Recording and restoring logical volume snapshots in LVM (part 3)
My server settings
  • Operating System-CentOS 6.5 with LVM installed
  • Server IP-192.168.0.200
Step 1: Create an LVM Snapshot

First, run the 'vgs 'command to check the free space in the volume group to create a new snapshot.

  1. # Vgs
  2. # Lvs

Check LVM disk space

As you can see, 8 GB of free space is available in the vgs command output. Therefore, let's create a snapshot for my volume named tecmint_datas. For demonstration purpose, I will use the following command to create a 1 GB snapshot volume.

  1. # Lvcreate-L 1 GB-s-n tecmint_datas_snap/dev/vg_tecmint_extra/tecmint_datas

Or

  1. # Lvcreate -- size 1G -- snapshot -- name tecmint_datas_snap/dev/vg_tecmint_extra/tecmint_datas

The two commands above are both doing the same thing:

  • -S-create a snapshot
  • -N-name the snapshot

Create an LVM Snapshot

Here is a description of the highlighted points above.

  1. The size of the snapshot I created here.
  2. Create a snapshot.
  3. The name of the created snapshot.
  4. The new snapshot name.
  5. The volume to create the snapshot.

If you want to remove a snapshot, you can use the 'lvdelete' command.

  1. # Lvremove/dev/vg_tecmint_extra/tecmint_datas_snap

Disk management-LVM

Linux Tutorial: Use LVM logical volume manager to manage flexible storage

Configure LVM (logical volume management) in CentOS 6.3)

Linux LVM (Logical Volume Manager) Study Notes

LVM-snapshot: LVM snapshot-based backup preparation

LVM-snapshot: LVM-based snapshot Backup

RHEL5.9 LVM usage

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • 4
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.