RHEL snapshot



## Preparation

pvs # view hdd
[root@lappdm05p ~]# pvs
  PV         VG       Fmt  Attr PSize     PFree
  /dev/sda2  rhel     lvm2 a--   <199.00g 1020.00m
  /dev/sdb1  datavg03 lvm2 a--  <1000.00g 1020.00m
  /dev/sdc1  datavg   lvm2 a--   <200.00g   96.00m

vgs # view volume
[root@lappdm05p ~]# vgs
  VG       #PV #LV #SN Attr   VSize     VFree
  datavg     1   1   0 wz--n-  <200.00g   96.00m
  datavg03   1   1   0 wz--n- <1000.00g 1020.00m
  rhel       1   9   0 wz--n-  <199.00g 1020.00m

lvs # view logical
[root@lappdm05p ~]# lvs
  LV          VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  Apps        datavg   -wi-a----- 199.90g
  Apps        datavg03 -wi-ao---- 999.00g
  BEA_TMP     rhel     -wi-ao----  20.00g
  home        rhel     -wi-ao----   2.00g    *****
  opt_IBM_ITM rhel     -wi-ao----   2.00g
  root        rhel     -wi-ao----  50.00g    *****
  swap        rhel     -wi-ao----   4.00g
  sysbackup   rhel     -wi-ao----  20.00g
  tmp         rhel     -wi-ao----  10.00g
  tmp_apps    rhel     -wi-ao----  70.00g
  var         rhel     -wi-ao----  20.00g    *****

======================================================

## Remove old snapshot
lvremove /dev/rhel/snap_root
lvremove /dev/rhel/snap_home
lvremove /dev/rhel/snap_var

## Create new snapshot
lvcreate -L 10G -s -n snap_root /dev/rhel/root
lvcreate -L 4G -s -n snap_home /dev/rhel/home
lvcreate -L 6G -s -n snap_var /dev/rhel/var

## Check snapshot status
lvs

## Fallback from snapshot
lvconvert --merge /dev/rhel/snap_root
lvconvert --merge /dev/rhel/snap_home
lvconvert --merge /dev/rhel/snap_var
reboot



posted @ 2025-08-26 20:26  k98091518  阅读(2)  评论(0)    收藏  举报