Manage LVM snapshots

LVM allow create snapshots of our system of an easy and fast way. A snapshot consist in a copy of the state at a particular point in time.
When we create a snapshot, initially only contains a hard links of our current data. Every time that a file or directory are modified that are linked by the snapshot, LVM automatically will clone the data to the snapshot. This policy also can known as copy on write (COW), with this way we can make a snapshot of 2 GB of a volume with 30 GB of size, while the changes are less than 2 GB.




I’ve one volume group of 80 GB named open2storage:



# vgdisplay


And one volume of 30 GB:


# lvdisplay



Now I’ll create the snapshot of the volume lv30 with 2 GB of size:


# lvcreate -L 2G -s -n lv30.snap /dev/open2storage/lv30
After create the snapshot and making changes on the original volume, we can see the status of the snapshot and the percentage of use:


# lvdisplay




We can mount the snapshot volume and backup the data with (tar, dd, cpio…)


# mount /dev/open2storage/lv30.snap /mnt/www-backup/

Nhận xét

Bài đăng phổ biến từ blog này

CLEANING UP THE ZABBIX DATABASE

[Resolved] Amazon EC2 Redhat 7 using 6GB for the root space

Connect to a different port with SQL Server Management Studio