I am currently spending my nights on testing ReactOS with Qemu 2.10.1+ KVM + VFIO. It is a good idea to have the iso to reinstall the system. All my drivers are already available on the iso. BUT I am under the impression to waste my time while recovering a virtual machine from scratch. Here LVM and snapshot are helpful

  • Check the volum for the current machine
    root@kvm-ReactOS:~# lvdisplay kvm-ReactOS-vg/ReactOS
      --- Logical volume ---
      LV Path                /dev/kvm-ReactOS-vg/ReactOS
      LV Name                ReactOS
      VG Name                kvm-ReactOS-vg
      LV UUID                XFDmtn-e2mQ-urGk-1EhV-85eZ-LcCv-v3qRi3
      LV Write Access        read/write
      LV Creation host, time kvm-ReactOS, 2017-11-02 03:00:29 +0100
      LV Status              available
      # open                 0
      LV Size                10,00 GiB
      Current LE             2560
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           252:7
  • Once you are happy with the current installation that it is time to create a backup using a snapshot from LVM system. I took the exact same size, 10GB.
    root@kvm-ReactOS:~# lvcreate -L10GB -s -n ReactOS_snapshot /dev/kvm-ReactOS-vg/ReactOS
      Using default stripesize 64,00 KiB.
      Logical volume "ReactOS_snapshot" created.
  • Later... - after doing some tests -.... on the current virtual machine, you can check its status using lvs
    root@kvm-ReactOS:~# lvs
      LV               VG             Attr       LSize  Pool Origin  Data%  Meta%  Move Log Cpy%Sync Convert
      ReactOS          kvm-ReactOS-vg owi-aos--- 10,00g                                                     
      ReactOS_good     kvm-ReactOS-vg -wi-a----- 10,00g                                                     
      ReactOS_snapshot kvm-ReactOS-vg swi-a-s--- 10,00g      ReactOS 21,69                                  
      home             kvm-ReactOS-vg -wi-ao---- 50,00g                                                     
      root             kvm-ReactOS-vg -wi-ao---- 23,28g                                                     
      swap_1           kvm-ReactOS-vg -wi-ao----  5,74g                                                     
      tmp              kvm-ReactOS-vg -wi-ao----  1,86g                                                     
      var              kvm-ReactOS-vg -wi-ao----  9,31g                                                     
  • If something gets wrong then you can to restore the snapshot
    root@kvm-ReactOS:~# lvconvert --merge /dev/kvm-ReactOS-vg/ReactOS_snapshot
      Merging of volume kvm-ReactOS-vg/ReactOS_snapshot started.
      ReactOS: Merged: 78,34%
      ReactOS: Merged: 80,99%
      ReactOS: Merged: 83,68%
      ReactOS: Merged: 86,55%
      ReactOS: Merged: 88,85%
      ReactOS: Merged: 89,71%
      ReactOS: Merged: 89,78%
      ReactOS: Merged: 91,20%
      ReactOS: Merged: 93,94%
      ReactOS: Merged: 96,54%
      ReactOS: Merged: 99,06%
      ReactOS: Merged: 100,00%
Keep it mind that
  • Snapshot will be destroyed once original volume has been restored
  • You may have to regenerate a new snapshot as backup -- if required --
Source: https://www.tecmint.com/take-snapshot-of-logical-volume-and-restore-in-lvm/