SITEMAPPED WEB DIRECTORY » Article Details
2.1 STORAGE MANAGEMENT RAID + LVM |
|
Date Added: April 05, 2018 06:59:00 PM | |
Author: Marion McKelvy | |
Category: Computers: Computer Backups | |
windows 7 usb backup image.2.4 Logical Volume Snapshots In addition, the LVM Logical Volume Manager also has a 'snapshot volume' feature, which is similar to the restore point-in-time functionality of the virtual machine software. For example, you can take a snapshot of an LV logical volume device. If you find that the data has been corrected in the future, you can overwrite and restore the snapshot volume you previously made. The snapshot function of the LVM Logical Volume Manager has two features. The size of the snapshot volume should be equal to the capacity of the LV logical volume as much as possible. The second is that the snapshot function is valid only once. Once it is restored, it is automatically deleted immediately. First, you should check the information of the lower volume group: [root@linuxprobe ~]# vgdisplay --- Volume group --- VG Name storage System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 39.99 GiB PE Size 4.00 MiB Total PE 10238 Alloc PE / Size 30 / 120.00 MiB Free PE / Size 10208 / 39.88 GiB VG UUID CTaHAK-0TQv-Abdb-R83O-RU6V-YYkx-8o2R0e... ............ omitted part of the output information .................... Through the output information of the volume group, it can be clearly seen that 120M is used in the volume group, and 39.88G of free resources are used. Next, write a file to the directory mounted on the logical volume device by using redirect: [root@linuxprobe ~]# echo 'Welcome to Linuxprobe.com' \u0026gt; /linuxprobe/readme.txt[root@linuxprobe ~]# ls -l /linuxprobetotal 14drwx------. 2 root root 12288 Feb 1 07 :18 lost+found-rw-r--r--. 1 root root 26 Feb 1 07:38 readme.txt Step 1: Use the -s parameter to generate a snapshot volume, use the -L parameter to specify the size of the cut, and remember to write this snapshot later for that LV logical volume device. [root@linuxprobe ~]# lvcreate -L 120M -s -n SNAP /dev/storage/vo Logical volume 'SNAP' created[root@linuxprobe ~]# lvdisplay--- Logical volume --- LV Path /dev/storage /SNAP LV Name SNAP VG Name storage LV UUID BC7WKg-fHoK-Pc7J-yhSd-vD7d-lUnl-TihKlt LV Write Access read/write LV Creation host, time localhost.localdomain, 2017-02-01 07:42:31 -0500 LV snapshot status active destination for vo LV Status available # open 0 LV Size 120.00 MiB Current LE 30 COW-table size 120.00 MiB COW-table LE 30 Allocated to snapshot 0.01% Snapshot chunk size 4.00 KiB Segments 1 Allocation inherit Ready ahead sectors auto - Currently set to 8192 Block device 253:3.................. omitted part of the output message .................... Step 2: Create a 100M junk file in the directory where the LV device volume is mounted. Then look at the status of the snapshot volume and you will see that the usage rate rises: [root@linuxprobe ~]# dd if=/dev/zero of=/linuxprobe/files count=1 bs=100M1+0 records in1+0 records out104857600 bytes (105 MB) copied, 3.35432 s, 31.3 MB/s[root @linuxprobe ~]# lvdisplay --- Logical volume --- LV Path /dev/storage/SNAP LV Name SNAP VG Name storage LV UUID BC7WKg-fHoK-Pc7J-yhSd-vD7d-lUnl-TihKlt LV Write Access read/write LV Creation host, time localhost.localdomain, 2017-02-01 07:42:31 -0500 LV snapshot status active destination for vo LV Status available # open 0 LV Size 120.00 MiB Current LE 30 COW-table size 120.00 MiB COW-table LE 30 Allocated to snapshot 83.71% Snapshot chunk size 4.00 KiB Segments 1 Allocation inherit Readable segments sectors auto - currently set to 8192 Block device 253:3 Step 3: In order to verify the effect of the SNAP snapshot volume, you need to perform a snapshot merge restore operation on the logical volume. Before this, remember to first uninstall the mount of the logical volume device and directory. [root@linuxprobe ~]# umount /linuxprobe[root@linuxprobe ~]# lvconvert --merge /dev/storage/SNAP Merging of volume SNAP started. vo: Merged: 21.4% vo: Merged: 100.0% Merge of snapshot into logical Volume vo has finished. Logical volume 'SNAP' successfully removed Step 4: The snapshot volume is automatically deleted and the 100M garbage file created just after the logical volume device was snapshotted is also cleared: [root@linuxprobe ~]# mount -a[root@linuxprobe ~]# ls /linuxprobe/lost+found readme.txt7.2.5 Delete the logical volume When the production environment wants to redeploy or does not need to continue to use the LVM Logical Volume Manager, in addition to backing up important data information in advance, you must also delete the LV logical volume, VG volume group, and then remove the PV physical volume device. The order cannot be reversed. Step 1: Remove the mounting association of the logical volume and the directory and delete the permanently valid device parameters in the configuration file. | |
|