View previous topic :: View next topic |
Author |
Message |
spartak n00b
Joined: 29 Jan 2003 Posts: 22
|
Posted: Wed Sep 29, 2010 5:51 pm Post subject: software raid1 ext4 info lost via hardware raid card init |
|
|
hi i had setup software raid1 with ext4 on two 1TB drives. I ran out of ports so I got an external raid card then i moved the drives to that and did an simple raid0 / single drive setup on them without initializing in hopes that i would just get the raw devices and my software raid would work. It seems that the raid card did some kind of initialization and now I cannot see the software raid1 or mount it as ext3 / ext4 when i just make one large partition. Is there some trick that anyone knows that i can align the partition again and mount as ext3/4. I have made an dd backup that i can fdisk. |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Wed Sep 29, 2010 6:31 pm Post subject: |
|
|
I think you will be best off working from your dd backup at this point, as the data on the drive is likely corrupted by now.
If you can't get the raid card to leave things alone and just pass through the actual devices, I suggest (best option) just get a different non-raid card, or you could set up raid according to your hardware card and then copy data into it (using dmraid I believe, but I can't offer exact advices on how to do this, as I have only used linux software raid).
The reason I recommend just a plain SATA card is because it's then interchangeable if you need to move the drives to another machine (that maybe uses a different bus type), or your controller card dies.
One problem you might run into is how to extract data from your dd image. The way I suggest to do this, is by manually calculating out the position of the partition (in bytes) using fdisk data. Then use the losetup command to create a loop device (/dev/loop0 for example) starting at that offset in the file (use -o option for offset), which you can then mount. You can use the same process if there are multiple partitions. One warning for this method, is that there is no longer any protection from the filesystem driver overwriting subsequent partitions, so if the data in the filesystem is corrupted, it may spray garbage over any partitions later on.
Hope this helps! |
|
Back to top |
|
|
spartak n00b
Joined: 29 Jan 2003 Posts: 22
|
Posted: Fri Oct 01, 2010 5:22 pm Post subject: |
|
|
Thanks for your reply! The dd image i made was after i made the misshap so that i can try the single big partition on that and hopefully mount it as ext3/4 which did not work. The drive I sent to data recovery guys. So if there is some way that i can scan the dd image for data or any other tricks on aligning partition table on the dd image / offsetting with the loop device please let me know! |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Fri Oct 01, 2010 9:20 pm Post subject: |
|
|
There are a couple options.
If you believe the filesystems are still intact, there are utilities that can rebuild a partition table by finding the filesystems. Try this first (I don't know the names offhand).
As a last resort, you can use something like photorec to recover stored files (but this is not effecive with filesystems that use tail packing, like reiserfs, but I think ext4 should be ok).
photorec/testdisk download link: http://www.cgsecurity.org/wiki/TestDisk_Download
photorec supported file formats for recovery (way more than just images!):
http://www.cgsecurity.org/wiki/File_Formats_Recovered_By_PhotoRec
If you use photorec, you will still not recover filenames. But, photorec works on all filesystems that tend to store data sequentially (or at least mostly sequentially). The main exception is reiserfs that uses tail packing, so no files are ever stored contiguously with reiserfs unless they are an exact multiple of the block size.
In the case where files are fragmented, photorec will try to fit them together by seeing what parts make a valid file. |
|
Back to top |
|
|
|