You are not logged in.

#1 2020-03-29 00:36:34

Trix213
Member
From: Germany
Registered: 2020-03-26
Posts: 19

Is this a proper backup strategy using LVM?

Good evening folks, a newbie talking wink

I am sneaking around Arch-based OS for around two weeks by now, using ArchLabs at first (and already posting and reading here). Yesterday I set up Arch from scratch and used LVM in the process, since I read it allows for easily applicable backup-strategies.
I read the wiki pages and tried it out by deleting some files and uninstalling some smaller programms and it worked all fine. Basically, I am asking for your approval of my backup process and/or comments and hints on whether I missed something integral.

My LVM disks are set up like this:

[root@Arch ~]# pvs
  PV         VG         Fmt  Attr PSize    PFree   
  /dev/sdc3  VolGroup00 lvm2 a--  <265.00g       0 
  /dev/sdc4  VolGroup00 lvm2 a--  <100.00g <100.00g

These are my two PVs, the 265G one for my root directory (~256G) and the swap file (~9G), the 100G for backups. I created LVs for swap and root directory:

[root@Arch ~]# lvs
  LV       VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  archroot VolGroup00 -wi-ao---- 256.00g                                                    
  archswap VolGroup00 -wi-ao----  <9.00g

Final step was adding those two LVs as well as the free PV for backups to a VG:

[root@Arch ~]# vgs 
  VG         #PV #LV #SN Attr   VSize   VFree   
  VolGroup00   2   2   0 wz--n- 364.99g <100.00g

I now backed up my data on the LV VolGroup00/archroot by issuing

lvcreate --size 50G --snapshot --name root_backup /dev/VolGroup00/archroot

which added root_backup as LV to my VG VolGroup00 with archroot as origin:

[root@Arch ~]# lvs
  LV          VG         Attr       LSize   Pool Origin   Data%  Meta%  Move Log Cpy%Sync Convert
  archroot    VolGroup00 owi-aos--- 256.00g                                                      
  archswap    VolGroup00 -wi-ao----  <9.00g                                                      
  root_backup VolGroup00 swi-a-s---  50.00g      archroot 0.01 

And this is where I have a few questions:

1) Can I load the backup using lvconvert --merge /dev/VolGroup00/root_backup safely at any time?
2) From what I've read in the wiki, I can change half the amount of data on archroot which I allocated to root_backup, so that would mean changes of 25G?
3) Follow-Up to question 2, what happens if I exceed this threshold? Do I produce errors in my backup unknowingly, do I get a notification by LVM, does the backup just stop "recording" the changes at this point?
4) Also taken from my understanding of the wiki, I could now go ahead and archive /dev/VolGroup00/root_backup using e.g. tar and save it somewhere save and mount it later, if needed, right?

I am sorry if these questions might seem a bit stupid to you, I just know myself and that I will experiment with Arch over the next few weeks and it would be good to know that my backups are waterproof so my progress is not suddenly gone for good for any reason.

Thanks in advance and good night,
Daniel smile


Edit: Rephrased the subject as a question

Last edited by Trix213 (2020-03-29 19:05:56)

Offline

Board footer

Powered by FluxBB