Skip to contentSkip to conversation

Recover fs

DISCUSSION Alberto (albertix.com) 2 participants 2 messages Oct 9, 2007 – Oct 10, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

This is my first question, sorry for my english.
I have a very serious problem. I've demage (suppose) data on XFS RAID 0 disk, I'll try explain steps:

before:
n.2 sata hard disk monted on raid0 with xfs fs

after:
n.2 sata hard disk monted on raid0 with reiser fs

Story:
Server is gentoo based OS with TYAN MB with n.4 SATA onboard can be configured in Raid0, raid1, raid0+1.
On another controller (PCI) was mounted another sata hd with OS. This hd was faulted, than I decide to mount 2 hd with raid1 configuration for better security. I've decided to move all same size disk to unique controller (on MB). When i moved this hard disks I've confused old disks with new and I've created new raid array on them. Old array was xfs fs and new one i've decided to make reiserfs. After creation of RAID, i've make "mkreiserfs /dev/md1", but not on each single hd Now I have new array (reiserfs) on disks witch before has very important data. When I saw my error, I've unmount array. With fdisk I see my sdc1 free space. In this exact moment i've lounched command: "xfs_repair -n /dev/sdc1".

I'm desperade (aprox. crying) , on this disks was 3 years of work data (web, db, materials). It's possibility to recover this data (nothing else was writing after on disk disks) ??? . Pls help me If is possibilty, I promise to make 10 copies (for penitency).

Alberto.

ALBERTIX.COM di Starosta Wojciech
Via Falcone e Borsellino, 11
47827 Villa Verucchio (RN)

tel: +39 0541 1796799
fax: +39 0541 1791899
mob: +39 3388908888

PIVA: 03583890409
CIAA: RN-299344
CF: STRWCC67S06Z127F

Banca: BANCA POPOLARE DELL'EMILIA ROMAGNA
Filiale: VILLA VERUCCHIO
ABI: 05387 CAB:68100
CC: 000001472060
CIN: B

#1 lore raw

Le Tue, 09 Oct 2007 11:43:22 +0200 vous écriviez:

Quoted 5 lines

I'm desperade (aprox. crying) , on this disks was 3 years of work data (web, db, materials).
It's possibility to recover this data (nothing else was writing after on disk disks) ??? . Pls help me
If is possibilty, I promise to make 10 copies (for penitency).

Alberto, apparently nobody cares to reply because 1) there's essentially nothing to do and 2) you deserved it. I'm sorry, but you really deserved it. Not backing up important data is plain stupid, but not backing up important data when moving it around is completely crazy.

Now there is only one thing you may still try, but you won't get back everything, and it will be very long and very painful : scan the hard drive one byte at a time, and look for something you know. If you're looking for JPG files, look for JPG headers, or HTML headers, for databases there's probably some sort of identifiable header too. I did it one for a 12 TB X>FS that went booom (2.6.17 bug) containing only DV files. Here is the perl program I used.

#!/usr/bin/perl

use strict;
use warnings;

my ( $file ) = @ARGV;
my $blocksize = 144000 ;

my $lookupstring = pack "H*", "1F0700" ;
my $regexp = qr/^(.*?)($lookupstring.*)$/s ;

open ( my $raid, "< $file" ) or die "impossible d'ouvrir $file \n" ;

{
        my $block ;
        my $offset = 0 ;
        my $nextblock = 0;
        my $testfile;

        my $outnumber = 0;
        seek $raid, $offset, 0 or die ;

        while ( my $readbytes = read $raid, $block, $blocksize ) {
                $offset += $readbytes ;
                if ( $block =~ m/$regexp/ ) {
                        print "trouvé, fichier $outnumber offset

$offset\n";

                        if ( $testfile ) {
                                print $testfile $1;
                                close $testfile or die "Peut pas
fermer, $! "; undef $testfile ;
                                $outnumber++;
                                open $testfile,
">/mnt/destination/out". sprintf ("%09d", $ outnumber) . ".dv" or die
"impossible d'écrire sur fichier $outnumber "; print $testfile $2 ;
                        } else {
                                print "OPEN\n";
                                open $testfile,
">/mnt/destination/out". sprintf ("%09d", $ outnumber) . ".dv" or die
"impossible d'écrire sur fichier $outnumber "; print $testfile $2 ;
                        }
                } else {
                        if ( $testfile ) {
                                print $testfile $block;
                        }
                }

                if ($offset > 14293651161088 ) {
                        print "fini....\n";
                        exit;
                }
        }

}

Signature · 3 lines
--------------------------------------------------
Emmanuel Florac               www.intellique.com   
--------------------------------------------------