Page 1 of 2

Recovering dd > gz partition backup

Posted: 2009/01/20 20:54:36
by josu
Hi all, the first my system is a CentOS_5.2 X64 with the Xen kernell.

I maked a gz backup with dd from the two partitions of a raid1 with ext3, then i'am trying to recover any of it into a lvm logic vol (bigger than the original partition size).

I did a dd if=theGzFile | gunzip | dd of=/dev/volGroup/name and later ... and later... when i try to mount it as ext3 i received:

incorrect file system type, incorrect option, incorrect superblok on /dev/VolGroup/name missing code page, or any other error BLA BLA BLA ... (Translated from spanish)

Then i try fsck.ext3 /dev/VolGroup/name receiving:

Couldn't find ext2 superblock, trying backup blocks...
/sbin/fsck.ext3: Bad magic number in super-block while trying to open /dev/VolGroupRaid5/ubuntu

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193

And using mdadm -E /dev/VolGroup/name gives me:

mdadm: No md superblock detected on /dev/VolGroupRaid5/ubuntu.

Not idea on where is my mistake/s, ?needs to be same partition size for recovering it? ?or worst, need to be the same partition? ?i cant recover it on a lvm logic volume?

thx for your help.

Recovering dd > gz partition backup

Posted: 2009/01/20 21:16:48
by gerald_clark
[quote]
I maked a gz backup with dd from the two partitions of a raid1 with ext3, then i'am trying to recover any of it into a lvm logic vol (bigger than the original partition size).
[/quote]

Backup the md device, not the component devices.

Re: Recovering dd > gz partition backup

Posted: 2009/01/20 21:37:10
by josu
Any chance of recovering it if i did it the wrong way?

i made the backup from the two fisical partitions sda and sdb.

:O(

Re: Recovering dd > gz partition backup

Posted: 2009/01/21 15:22:31
by gerald_clark
Not that I am aware of.
You compressed while you copied, so you can't just copy half of the backup.
If you have a big enough temp storage, you may be able to uncompress the archive, and cut it in half.
This all assumes there was a file system on the RAID device, and not a PV/VG/LV. You may not have
duplicate Logical Volume names or filesystem labels on a machine.

Re: Recovering dd > gz partition backup

Posted: 2009/01/21 16:41:39
by josu
Thank u Gerald.

Probably i dont tell my problem so well. I have 2 .gz backup files one from sda1 and the other one from sdb1, the original configuration is :

ext3
-----
md1 (raid1)
--------------
sda2 sdb2



And when i recover any of the partitions on a logical volume (bigger than the original partition, created by the LVM GUI and without any kind format), then i cant get any usefull information from mount, fsck.ext3 or mdadm system commands.

I have enougth space on the LVM for recovering the 2 partitions if its needed.

?any idea?

Thx.

Re: Recovering dd > gz partition backup

Posted: 2009/01/21 17:28:02
by gerald_clark
Uncompress a copy of one of your backups, and loop mount it.
Then you can make a filesystem on your new LV and rsync the files to it
from the loop mounted filesystem.

Re: Recovering dd > gz partition backup

Posted: 2009/01/22 00:53:45
by josu
Same results.

I decompresed the two images and mounted at /dev/loop3 and /dev/loop4 with losetup:

losetup -r /dev/loop3 /opt/sdc1 /opt/sdd1.gz
dd if=/dev/sdc1 | gzip > /opt/sdc1.gz

i am going to try system rescue cd live distro.

Re: Recovering dd > gz partition backup

Posted: 2009/01/22 12:39:35
by AlanBartlett
[quote]i found it after a lot of arrow up pressing :O) [/quote]
The inbuilt shell command [i]history[/i] would have assisted you.

Try [b]history | more[/b] . . .

Re: Recovering dd > gz partition backup

Posted: 2009/01/22 14:24:35
by gerald_clark
You stated before that you made the backups from sda1 and sdb1.
Now you say you made them from sdc1 and scd1.

Instead of messing around with losetup, mount them as I told you before.
use the -o loop option to mount.

I suspect you never actually backed up a real filesystem, or it was a filesystem
not supported by the standard kernel.

Re: Recovering dd > gz partition backup

Posted: 2009/01/22 16:08:16
by josu
Gerald.

I made this backups some months ago, maybe a year. Initialy this two drives are sda and sdb and its what iam remembering when i write the first post. Later after puting two drives more in the system these unit becomes sdc and sdd.

The first thing that i tried is to loop mount these images and it shown me the same error about the filesystem or the superblock, i dont remember now, iam at the office and the machine is at my house. But i supouse that mount -o loop == losetup + normal mount, and i told you that the image ties with the loop but dont mount and cant be recognized as ext3 partition or a raid partition.

The filesystem was created by a ubuntu 6.06 LTS 32 bits server with a 2.6.15 kernell, y supouse that this is not a problem for CentOS 5.

Thx by your time.