Answer the question
In order to leave comments, you need to log in
How to make a full system backup (Linux) rsync or tar?
Good time colleagues!
It is necessary to automate the backup of virtual machines (Linux) running qemu/kvm.
You need to completely back up "/".
The process of mounting the qcow machine and other preparatory steps have already been done and there are no difficulties.
/ (stopped) virtual machine is mounted in / mnt
Tried via rsync
rsync -av /mnt /srv/vm_name
Recovered the same way
rsync -av /srv/vm_name /mnt
The system crashes on the initramfs. Probably something with file permissions.
I tried with tar
cd /mnt
tar -cvzpf /srv/vm_name.tar.gz .
cd /mnt
tar --same-owner -xvpf /srv/vm_name.tar.gz
Answer the question
In order to leave comments, you need to log in
where did the idea come from that these might be suitable options?
this is not true.
running qemu/kvm.
I don’t know why, but you can look at rear
https://relax-and-recover.org/
there are both tar and rsync and whatever you
want
There are also snapshots, on the level of QEMU or libvirt. You can read HERE
So, first and foremost - the method, format and time of creating a backup should be determined by the methods by which this backup will be restored.
(if virtual machines are used, look, perhaps the tools built into the hypervisor already contain the answer. For example, if snapshots are not used, then a database backup is a copy of its disk container files)
Second, there are a huge number of ways to create an operating system backup, each of them is distinguished by the convenience of both creating a copy and restoring it, and the pros are not always combined with the cons.
File-level backup is rsync or tar, allows you to control what to copy and what to skip at the file level, but the slowest possible. Remember, if files are being written to, then normally a backup copy can only be made from a snapshot or by turning off the machine. To restore, this method requires the most gestures, but as one of the steps, a
backup at the block device level is quite acceptable:
* as I already said, if the virtual machine uses files to store disk images, you can simply copy them (by disabling or suspending it by itself , or using hypervisor snapshots)
* you can copy disks from the inside from the guest system using its tools, in this case you can use its snapshot technology
For example, in linux, when using btrfs, you can instantly create a snapshot and get the difference between this snapshot and the previous one in the form of a file (stream), store them and then apply these incremental copies sequentially to another starting copy of the disk (this can be done starting from an empty disk)
An important point , to obtain guarantees, it is better to either stop the databases while creating a copy or do a backup using its means, otherwise the probability of problems during their restoration will not be zero.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question