OpenVZ disk image backup quick question

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

TangoWhiskey9

Active Member
Jun 28, 2013
402
59
28
Here is one that I have failed multiple times on now. I have an openvz disk image running a small website. I wanted to copy it over to a remote directory so that I can test on a backup of the image.

When I do
Code:
tar cvzf image.tgz vm-disk.raw
vm-disk.raw
tar: vm-disk.raw: file changed as we read it
I don't know who "we" is but the copy fails. Does anyone have an idea how to fix this? It is a 40GB directory so gzip takes quite awhile. Also hard to keep this constant during the copy.
 

rubylaser

Active Member
Jan 4, 2013
846
236
43
Michigan, USA
Normally, it's easier to have your VMs on top of LVM. That way you can utilize LVM's snapshot ability to take an image of a running machine. If this isn't on LVM, about the only way to get a good backup of the whole VM is to shut it down, create your tar.gz and then restart the VM. Or, you could create another VM and use rsync or tar with the one-filesystem option to make a backup that you use on the test VM.
 

TangoWhiskey9

Active Member
Jun 28, 2013
402
59
28
Or, you could create another VM and use rsync or tar with the one-filesystem option to make a backup that you use on the test VM.
Any link on how to do this? I could setup rsync to a new VM. Actually, the .raw disk image only has 8GB used so that may be a strong option.
 

rubylaser

Active Member
Jan 4, 2013
846
236
43
Michigan, USA
Here's one for a whole system backup with rsync.
And, here's one with tar.

The main tool that is used with LVM is vzdump (it's what Proxmox uses for OpenVZ backups). I forgot to mention that in my first post. vzdump really should be your first OpenVZ container backup tool. This page explains the various methods to reduce downtime.
 
Last edited:
  • Like
Reactions: Chuckleb

Patrick

Administrator
Staff member
Dec 21, 2010
12,514
5,807
113
rubylaser - great post.

I just made your links in bold so folks can see them easier.
 

LOLoye7

New Member
Jan 27, 2015
1
0
1
32
I have a tutorial in my signature if you are interested. For my home data, the ability to add a disk at a time, while also supporting more than 1 parity disk (UnRAID only allows 1 parity disk), and being free, makes SnapRAID a no brainer for me. If you have any questions, I'm happy to try to answer them.
 

rubylaser

Active Member
Jan 4, 2013
846
236
43
Michigan, USA
I have a tutorial in my signature if you are interested. For my home data, the ability to add a disk at a time, while also supporting more than 1 parity disk (UnRAID only allows 1 parity disk), and being free, makes SnapRAID a no brainer for me. If you have any questions, I'm happy to try to answer them.
This doesn't seem to fit the conversation. Also, if you are going to quote someone verbatim, it's nice to give them credit :)