0

I used mkfs.exfat /dev/md0p1 by mistake, and killed my RAID 1 instead of formatting a micro SD card. Very dumb, I know. How can I undo this colossal mistake? I'm reasonably confident that the two hard drives that used to make up the RAID are still intact, since all I have done is run pointless mdadm and testdisk checks since The Incident. It's just that the MD file system has been ruined and/or made inaccessible ever since I told the machine to make it exfat.

I'm obviously happy to post the results of any checks that anyone needs to see to help with this, but it is a little tricky since I can only run the damaged machine in "recovery root shell" mode--I just have to retype any output on the tablet I'm using to post this question.

EDIT to add a few details: Ubuntu 14.04 is installed on a separate hard disk. The RAID was mounted as my /home directory.

18
  • 1
    Simply restore your \home from your latest backup. (You did make a backup, right?) To save having to retype any output on your tablet, boot your system from a live media which will allow you to copy and paste output rather than retyping which could lead to errors and further confusion. Note that RAID 1 is a mirror with both drives containing the same data. Running Testdisk on the individual drives might yield results.
    – Elder Geek
    Mar 20, 2016 at 15:46
  • The RAID was the backup, unfortunately. Until a few days ago, I lacked the imagination to foresee a situation where I would destroy it completely in one fell swoop. I only anticipated needing to use the mirror because of a hardware failure--not a "me failure."
    – Zombiecube
    Mar 20, 2016 at 16:03
  • With ultimate power comes ultimate responsibility. Have you tried using Testdisk to recover files off one member of the RAID 1 set?
    – Elder Geek
    Mar 20, 2016 at 16:06
  • 1
    IT Systems Admin 101: Do Not Rely on RAID as a Sole Backup Solution. I hate to make this statement but it is 100% accurate...
    – Thomas Ward
    Mar 24, 2016 at 0:07
  • 1
    Re "Do not rely on RAID as a sole backup solution" - it's better not treat it as a backup at all, because that's not what it does. It's designed to reduce downtime of an always-on system in the event of a hardware failure of a single drive. It doesn't help in case of accidental deletion, data corruption, virus attack, unauthorised access, hardware failure in things other than a single drive (eg drive controller, motherboard, power supply), etc which are other reasons for needing backup. Mar 24, 2016 at 2:07

2 Answers 2

1

Break the mirror by placing one of the two drives on the shelf and do not do anything to it. (At least you'll be no worse off than you are now)

Try to access the other drive directly with sudo testdisk to see if you can find the ext partition that you mangled and/or files that remain on the disk. If this fails and the data is critical to you, you can use a professional data recovery service such as Ontrack to recover most of the data from the unmodified (since the incident) disk on the shelf.

EDIT: Based on your recent comment regarding family photos you might try photorec which is part of the testdisk package. Since the photorec approach is based on the underlying data and ignores the filesystem you may get decent results. You will need a drive with sufficient space to recover the files to.

More information is available here and a step by step tutorial can be found on this page as man photorec might seem a bit cryptic.

1
  • Knowing the disk was just modified, the method to use a file recovery system should yield decent results.
    – user508889
    Mar 24, 2016 at 2:00
0

This is what I would do:

1º Unplug the hard drive you accidentaly formatted and plug it in another computer 2º Install in that computer the RAID controllers 3º Use an app like GetBackDataNTFS (windows) to recover your hdd

1
  • If you read the comments you'll discover that the original filesystem was ext4 and no Windows software will recognize that.
    – Elder Geek
    Mar 24, 2016 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .