LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   I accidentally mkfs.ext4'd my Windows partition (https://www.linuxquestions.org/questions/slackware-14/i-accidentally-mkfs-ext4d-my-windows-partition-4175501165/)

moisespedro 04-09-2014 08:33 PM

I accidentally mkfs.ext4'd my Windows partition
 
And as soon as I realised what I've done I quickly stopped the process with ctrl-c. Is there any way to recover it? I don't care much about the Windows installation, I care more about the files that were there. I am using testdisk right now. Any tips?

Emerson 04-09-2014 08:52 PM

testdisk is for recovering partitions. Running mkfs.ext4 will overwrite certain areas where ext4 metadata is stored. Meaning your files cannot be restored in full. Try photorec if you are desperate.
Any hard drive can die at any time. That's what backups are for.

hitest 04-09-2014 08:53 PM

I trust you have back ups?

moisespedro 04-09-2014 08:55 PM

Quote:

Originally Posted by Emerson (Post 5149816)
testdisk is for recovering partitions. Running mkfs.ext4 will overwrite certain areas where ext4 metadata is stored. Meaning your files cannot be restored in full. Try photorec if you are desperate.
Any hard drive can die at any time. That's what backups are for.

Oh damn

Quote:

Originally Posted by hitest (Post 5149818)
I trust you have back ups?

Sadly not :( Am I doomed?

Emerson 04-09-2014 09:13 PM

Just a friendly advice for future. I have my files synchronized on 4 nodes on my network. Chances that 4 hard drives die at once are slim. Yet, I do back up my static files to archive grade DVD's. FYI, archive grade DVD will store your data for 100 years.

ReaperX7 04-09-2014 09:36 PM

Chances are because you used mkfs.ext4 and stopped it that you might not be able to restore the Windows Partition outright but there are some options...

Download a copy of Hiren's Boot Disk http://www.hiren.info/pages/bootcd and try using the Recuva utility (as well as other Recovery Tools) and see if you can Recover any lost data and save it to another hard disk.

moisespedro 04-09-2014 10:03 PM

photorec is recovering some files, It is kinda boring and time consuming since I have to go to each directory it creates and search for what I want. I think I am fine now.

Emerson 04-09-2014 10:43 PM

Glad you are able to recover, I suggest you develop a backup solution that fits your situation best.

Mark Pettit 04-10-2014 12:40 AM

Man - I feel for you. This is a mistake you only make once.

jtsn 04-10-2014 02:27 AM

Disaster recovery will not work, if your don't practice it regularly. Let someone set a random alarm in the current year, where you don't know in advance when it happens. The second it rings, immediately pull your hard drive and pretend all data is lost. If you're using RAID, pretend it failed during the rebuild (yes, that happens!).

Then look how fast your can recover and how much data you've lost. Of course, this will happen at the worst moment, but that's part of drill, don't postpone it. Once you've successfully practiced it multiple times, you won't lose important data anymore. And of course, you won't be thrown off by a drive failure or a fatal operating error. It will be just be a task like replacing a broken incandescent lamp.

moisespedro 04-10-2014 04:13 AM

It recovered 100+ GB of data, most of it it is useless like browser cache etc but I will see what I can get back. I used photorec btw.
EDIT: noob question here: photorec created more than 1000 directories. I would like to search for all PNG/JPG on it without having to go to each one of them. How do I do this from command line?

phenixia2003 04-10-2014 04:33 AM

Hello,

Quote:

Originally Posted by moisespedro (Post 5149960)
EDIT: noob question here: photorec created more than 1000 directories. I would like to search for all PNG/JPG on it without having to go to each one of them. How do I do this from command line?

If the +1000 directories are in a given folder called photorec, then you can do this :

Code:

$ find photorec -type f -iname "*.png" -o -iname "*.jpg"
--
SeB

EYo 04-10-2014 06:36 AM

Quote:

Originally Posted by moisespedro (Post 5149960)
EDIT: photorec created more than 1000 directories. I would like to search for all PNG/JPG on it without having to go to each one of them. How do I do this from command line?

http://www.cgsecurity.org/wiki/After_Using_PhotoRec

moisespedro 04-10-2014 10:50 AM

Quote:

Originally Posted by EYo (Post 5150007)

Thanks phenixia but I ended using what EyO posted, the python script didn't work so I used this, I already had wine installed so it was no problem.

EDIT: Well, it seems it is not working

EDIT2: Found this, was very useful

EDIT3: Will mark this as solved and man this gonna be a hell of a job because photorec literally recover ALL files, I have many duplicate images, thumbnails, images from internet cache. Well, lesson learned, will set up a backup for this from now.

Woodsman 04-10-2014 12:25 PM

Even well designed backup plans fail. Like the day my external backup drive failed --- in the middle of a backup. :)


All times are GMT -5. The time now is 01:08 PM.