Re: how to recover filesystem after clobbering array?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've successfully recovered my array data. :)
All it took was, as I expected, to rebuild the right pointers. The data was always untouched.
Here it goes, for the sake of completeness.

I initially used "mdadm --create --assume-clean ..." on a level1 array of 2 disks that came from another machine. I didn't know any other way of starting an array in this situation. While this is an acceptable practice in some cases, it is better to use "--assemble" and pass the necessary info (like uuid).

Unfortunately I apparently lost all the data because the newly created metadata superblock was the default 0.9 version, and the original array metadata version was 1.2, and this resulted in a missing partition table once the array was run.

Then I retrieved the mdadm.conf file from the original machine, and there I found the correct metadata version, uuid, array name, array device name. I also double-checked the volume partition and filesystem type from that machine's /etc/fstab.

So, I zeroed-out the metadata superblocks with "mdadm --zero-superblock ...", and then proceeded to restore the original metadata superblock with "mdadm --create --assume-clean --metadata=1.2 --uuid=... --name=... --level=1 --raid-devices=2 /dev/sde1 missing", and it worked just fine. The array was started and I could see the original data partition with fdisk and actually mount it. After this successful test, I just added the other disk to the array.

The one information I expected from this list was: "No problem, your data is still there. If you can recreate the superblock with the same metadata version as it used to be, everything reverts to normal." Unfortunately I had no such support.

Cheers,
Vasco.

On 19-07-2011 12:01, Vasco Névoa wrote:
Thank you very much, Tyler and David.
Good advice.

The array is level 1, built upon primary partitions of the devices.
The file system is EXT4.
The mdadm command that I stupidly used to create instead of starting the array included "--assume-clean" but no "--build". I checked via /proc/mdadm that the array came up without syncing anything (or at least it was ultra-fast, less than 5 seconds).
So I firmly believe the data is all there, on both disks.
I just need to rebuild the metadata to point to the data again somehow.
Right?...

Citando "Tyler J. Wagner" <tyler@xxxxxxxxxxx>:

On 2011-07-19 11:17, David Brown wrote:
Once you have got image files for each of your disks, make copies of
these image files to another spare disk. Keep careful notes of exactly
what you have done here, and which files are which. And put your
original disks, carefully labelled, on a shelf somewhere.

Now you are in a position to attempt data recovery on your copied
files. If you do something wrong, you can simply re-copy the image
files and try again. You still have absolutely no guarantees that
you'll get anything back - but at least you can be sure you are not
going to make anything worse.

Follow David's advice.

What was the filesystem on the array?

Now, use testdisk, photorec, and foremost to seek through the raw images
and extract files. The good news is, most video formats are detectable
by these tools. All can be installed with your package manager.

Regards,
Tyler

--
"Offending fundamentalists isn't my goal - but if it is an inevitable
side-effect of defending human rights, so be it."
   -- Johann Hari

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux