Partial restoration from backup

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

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,

Oh one additional question, what type of VPS is it that you're attempting to retrieve files from?

Steffan's picture
Submitted by Steffan on Thu, 11/19/2015 - 13:12 Pro Licensee

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?

Steffan's picture
Submitted by Steffan on Thu, 11/19/2015 - 13:21 Pro Licensee

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.

What kind of VM is this? The backup format is quite different for disk-based VMs (like KVM and Xen) versus OpenVZ or LXC.

Steffan's picture
Submitted by Steffan on Thu, 11/19/2015 - 14:22 Pro Licensee

Xen, sorry.

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

Steffan's picture
Submitted by Steffan on Sat, 11/21/2015 - 09:09 Pro Licensee

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

If you run the file command on that file, what does it output?

Steffan's picture
Submitted by Steffan on Sat, 11/21/2015 - 19:19 Pro Licensee

file showed that it was a gzip archive. I used a tool to recover the archive.

# file saguarogold.hldns.ext3
saguarogold.hldns.ext3: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)

Tried mounting it then. No luck.

[root@db tmp]# mount -t ext3 saguarogold.hldns.ext3 /mnt/recover
mount: /home/backup/tmp/saguarogold.hldns.ext3 is not a block device (maybe try `-o loop'?)
[root@db tmp]# mount -t ext3 saguarogold.hldns.ext3 /mnt/recover -o loop
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Suggestions?

Trying to run fsck on it.

Try using -t ext4 if it was from a newer Linux distribution.

Steffan's picture
Submitted by Steffan on Sat, 11/21/2015 - 23:16 Pro Licensee

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!

Steffan's picture
Submitted by Steffan on Sun, 11/29/2015 - 10:06 Pro Licensee

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!