Recovering dd > gz partition backup

General support questions including new installations

Recovering dd > gz partition backup

Postby josu » 2009/01/20 20:54:36

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.
josu
 
Posts: 12
Joined: 2009/01/01 18:15:44

Recovering dd > gz partition backup

Postby gerald_clark » 2009/01/20 21:16:48

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).


Backup the md device, not the component devices.
gerald_clark
 
Posts: 9250
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Recovering dd > gz partition backup

Postby josu » 2009/01/20 21:37:10

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(
josu
 
Posts: 12
Joined: 2009/01/01 18:15:44

Re: Recovering dd > gz partition backup

Postby gerald_clark » 2009/01/21 15:22:31

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.
gerald_clark
 
Posts: 9250
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Recovering dd > gz partition backup

Postby josu » 2009/01/21 16:41:39

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.
josu
 
Posts: 12
Joined: 2009/01/01 18:15:44

Re: Recovering dd > gz partition backup

Postby gerald_clark » 2009/01/21 17:28:02

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.
gerald_clark
 
Posts: 9250
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Recovering dd > gz partition backup

Postby josu » 2009/01/22 00:53:45

Same results.

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

losetup -r /dev/loop3 /opt/sdc1 <-- the image file

It goes well but when i try mdadm -E and fcsk.ext3 it gives me the same results, no superblock ...

This is the exact commands that i used to made the compressed files, i found it after a lot of arrow up pressing :O)

dd if=/dev/sdd1 | gzip > /opt/sdd1.gz
dd if=/dev/sdc1 | gzip > /opt/sdc1.gz

i am going to try system rescue cd live distro.
josu
 
Posts: 12
Joined: 2009/01/01 18:15:44

Re: Recovering dd > gz partition backup

Postby AlanBartlett » 2009/01/22 12:39:35

i found it after a lot of arrow up pressing :O)

The inbuilt shell command history would have assisted you.

Try history | more . . .
User avatar
AlanBartlett
Forum Moderator
 
Posts: 9172
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

Re: Recovering dd > gz partition backup

Postby gerald_clark » 2009/01/22 14:24:35

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.
gerald_clark
 
Posts: 9250
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Recovering dd > gz partition backup

Postby josu » 2009/01/22 16:08:16

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.
josu
 
Posts: 12
Joined: 2009/01/01 18:15:44

Next

Return to CentOS 5 - General Support

Who is online

Users browsing this forum: No registered users and 4 guests