Perhaps I missed it in the docs but this is kind of a rush so, I'm trying a ticket rather than forum.
I need to restore only a handful of files from a cloudmin VM archive. I have the the .gz file but wasn't sure what the best approach is to unarchive and access it all. I've never had to do that before.
gzip -d file.gz didn't do it.
gzip: file.gz: invalid compressed data--format violated
Status:
Closed (fixed)
Comments
Submitted by andreychek on Thu, 11/19/2015 - 10:53 Comment #1
Sorry for the delay, I know you said you were in a rush... I'm looking into some ideas of how to do this in a way that doesn't require a second server.
If you're really in a hurry, you could always install Cloudmin onto a second system though, and restore the backup there.
But hopefully I'll find a good way for doing that shortly -- or Jamie may have some thoughts too,
Submitted by andreychek on Thu, 11/19/2015 - 10:57 Comment #2
Oh one additional question, what type of VPS is it that you're attempting to retrieve files from?
I'm not sure if it's how I'm downloading the archive. I'm using s3cmd to do it but the first time I had an error.
WARNING: MD5 signatures do not match: computed=9cd0d2042a3f091d2ab48622b05426da, received=53a9c235ab60854f374ba34e1ab48ad6
I'm downloading again to see if that was the issue or what. The VM was set up as a logical volume rather than a file. Once this finishes, is it a matter of mounting a volume or did CM do something with it before backing it up to the remote server?
CentOS 6. It was setup as a LVM rather than a file through CM. CM backed it up to another server on the network over SSH and then that other server used s3cmd pushed it to amazon s3.
I have some compromised files that need to be replaced and the local backup was too new for me to tinker with so, I have to go to the offsite backup for them.
Submitted by JamieCameron on Thu, 11/19/2015 - 13:29 Comment #5
What kind of VM is this? The backup format is quite different for disk-based VMs (like KVM and Xen) versus OpenVZ or LXC.
Xen, sorry.
Submitted by JamieCameron on Thu, 11/19/2015 - 17:09 Comment #7
So for Xen, the backup is a gzip-compressed filesystem image. Once you've uncompressed it, you can access the filesystem inside with a command like :
mount /path/to/your-vm.ext3 /mnt/restore
What command and flags does CM use to create the archive? I'm tying to figure out if it's the way s3cmd uploaded the file to AWS S3 or if it's the way I am downloading it. No matter what I do, I get this:
gzip: file.gz: invalid compressed data--format violated
Submitted by JamieCameron on Sat, 11/21/2015 - 13:47 Comment #9
If you run the
file
command on that file, what does it output?file showed that it was a gzip archive. I used a tool to recover the archive.
Tried mounting it then. No luck.
Suggestions?
Trying to run fsck on it.
Submitted by JamieCameron on Sat, 11/21/2015 - 22:52 Comment #11
Try using
-t ext4
if it was from a newer Linux distribution.It's definitely ext3. I am running fsck on it to recover the data. Thankfully I only need a little but its taking a while since its a big volume. I was finally able to mount it. Thanks!
I was able to get it to mount. I was working within the directory of the image using mount. The issue lied in the fact that you have to provide the full path to mount. Relevant paths don't work! I must have missed that on the man page.
Thank you as always for the quick help!