[SOLVED] I accidentally mkfs.ext4'd my Windows partition
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Last edited by moisespedro; 04-10-2014 at 11:26 AM.
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.
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.
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.
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.
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.
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.
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?
Last edited by moisespedro; 04-10-2014 at 04:15 AM.
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
Last edited by phenixia2003; 04-10-2014 at 04:42 AM.
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?
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.
Last edited by moisespedro; 04-10-2014 at 11:26 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.