[1]. LVM 설정 복구
- LVM 설정을 이전 설정으로 되돌리는 기능 입니다.
- 설정정보가 /etc/lvm/archive에 저장 됩니다.
1. 설정 복구 목록 조회(vgcfgrestore --list VG이름)
[root@localhost ~]# vgcfgrestore --list vg_data File: /etc/lvm/archive/vg_data_00001-783679087.vg VG name: vg_data Description: Created *before* executing 'lvcreate --extents 100%FREE -n lv_data vg_data' Backup Time: Tue Mar 9 00:31:44 2021 File: /etc/lvm/archive/vg_data_00002-1945892956.vg VG name: vg_data Description: Created *before* executing 'lvremove /dev/vg_data/lv_data' Backup Time: Tue Mar 9 00:38:09 2021 File: /etc/lvm/archive/vg_data_00003-604145499.vg VG name: vg_data Description: Created *before* executing 'lvcreate --extents 100%FREE -n data vg_data' Backup Time: Tue Mar 9 00:38:28 2021 File: /etc/lvm/archive/vg_data_00004-2003983229.vg VG name: vg_data Description: Created *before* executing 'lvremove /dev/vg_data/data' Backup Time: Fri Mar 19 23:43:01 2021 File: /etc/lvm/archive/vg_data_00005-1847044180.vg VG name: vg_data Description: Created *before* executing 'vgremove vg_data' Backup Time: Fri Mar 19 23:43:24 2021 File: /etc/lvm/archive/vg_data_00007-189896365.vg VG name: vg_data Description: Created *before* executing 'lvcreate -l 100%VG -n data vg_data' Backup Time: Sat Mar 20 01:50:17 2021 File: /etc/lvm/archive/vg_data_00008-1787301503.vg VG name: vg_data Description: Created *before* executing 'pvscan --cache --activate ay 8:32' Backup Time: Sun Mar 21 00:43:52 2021 File: /etc/lvm/archive/vg_data_00009-1580227359.vg VG name: vg_data Description: Created *before* executing 'pvscan --cache --activate ay 8:32' Backup Time: Sun Mar 21 00:43:52 2021 File: /etc/lvm/archive/vg_data_00010-738275568.vg VG name: vg_data Description: Created *before* executing 'pvresize /dev/sdb1' Backup Time: Tue Mar 23 02:40:28 2021 File: /etc/lvm/archive/vg_data_00011-312515778.vg VG name: vg_data Description: Created *before* executing 'lvextend -l +100%FREE /dev/vg_data/data' Backup Time: Tue Mar 23 03:05:27 2021 File: /etc/lvm/archive/vg_data_00012-730797510.vg VG name: vg_data Description: Created *before* executing 'lvreduce -L 1G /dev/vg_data/data' Backup Time: Tue Mar 23 03:24:11 2021 File: /etc/lvm/archive/vg_data_00013-959378912.vg VG name: vg_data Description: Created *before* executing 'lvextend -l +100%FREE /dev/vg_data/data' Backup Time: Tue Mar 23 03:32:30 2021 File: /etc/lvm/backup/vg_data VG name: vg_data Description: Created *after* executing 'lvextend -l +100%FREE /dev/vg_data/data' Backup Time: Tue Mar 23 03:32:30 2021 [root@localhost ~]#
2. 설정 복구 진행(vgcfgrestore -f 리스토아 파일 VG이름 )
[root@localhost ~]# vgcfgrestore -f /etc/lvm/archive/vg_data_00013-959378912.vg vg_data Restored volume group rhel
[2]. 설정 복구 확인
[root@localhost ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 vg_root lvm2 a-- <149.51g 8.00m /dev/sdb1 vg_data lvm2 a-- <15.00g 5.00g /dev/sdc vg_data lvm2 a-- <15.00g 5.00g [root@localhost ~]# [root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree vg_data 2 1 0 wz--n- 29.99g 10.00g vg_root 1 5 0 wz--n- <149.51g 8.00m [root@localhost ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert data vg_data -wi-ao---- 19.99g home vg_root -wi-ao---- 70.50g root vg_root -wi-ao---- 15.00g swap vg_root -wi-ao---- 4.00g usr vg_root -wi-ao---- 50.00g var vg_root -wi-ao---- 10.00g [root@localhost ~]#