LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-09-2014, 08:33 PM   #1
moisespedro
Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware and LFS
Posts: 943

Rep: Reputation: 108Reputation: 108
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?

Last edited by moisespedro; 04-10-2014 at 11:26 AM.
 
Old 04-09-2014, 08:52 PM   #2
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
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.
 
Old 04-09-2014, 08:53 PM   #3
hitest
Senior Member
 
Registered: Mar 2004
Location: Prince Rupert, B.C., Canada
Distribution: Slackware, OpenBSD
Posts: 4,191

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
I trust you have back ups?
 
Old 04-09-2014, 08:55 PM   #4
moisespedro
Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware and LFS
Posts: 943

Original Poster
Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by Emerson View Post
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 View Post
I trust you have back ups?
Sadly not Am I doomed?
 
Old 04-09-2014, 09:13 PM   #5
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
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.
 
Old 04-09-2014, 09:36 PM   #6
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,405
Blog Entries: 15

Rep: Reputation: 952Reputation: 952Reputation: 952Reputation: 952Reputation: 952Reputation: 952Reputation: 952Reputation: 952
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.
 
Old 04-09-2014, 10:03 PM   #7
moisespedro
Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware and LFS
Posts: 943

Original Poster
Rep: Reputation: 108Reputation: 108
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.
 
Old 04-09-2014, 10:43 PM   #8
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
Glad you are able to recover, I suggest you develop a backup solution that fits your situation best.
 
Old 04-10-2014, 12:40 AM   #9
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 14.1 64 Multi-Lib
Posts: 435

Rep: Reputation: 138Reputation: 138
Man - I feel for you. This is a mistake you only make once.
 
Old 04-10-2014, 02:27 AM   #10
jtsn
Member
 
Registered: Sep 2011
Location: Europe
Distribution: Slackware
Posts: 806

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
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.
 
Old 04-10-2014, 04:13 AM   #11
moisespedro
Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware and LFS
Posts: 943

Original Poster
Rep: Reputation: 108Reputation: 108
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.
 
Old 04-10-2014, 04:33 AM   #12
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 293

Rep: Reputation: 166Reputation: 166
Hello,

Quote:
Originally Posted by moisespedro View Post
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.
 
Old 04-10-2014, 06:36 AM   #13
EYo
Member
 
Registered: Jun 2009
Location: Cloverdale
Distribution: Slackware
Posts: 53

Rep: Reputation: 27
Quote:
Originally Posted by moisespedro View Post
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
 
Old 04-10-2014, 10:50 AM   #14
moisespedro
Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware and LFS
Posts: 943

Original Poster
Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by EYo View Post
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.

Last edited by moisespedro; 04-10-2014 at 11:26 AM.
 
Old 04-10-2014, 12:25 PM   #15
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mkfs.ext4 on a 3.7TB partition creates a 1.6TB file system PeterSteele Red Hat 3 09-17-2013 08:35 AM
Windows vista can't read my ntfs partition created by mkfs Leo Simon Linux - Hardware 1 10-16-2010 10:55 AM
recovering a 'ntfs' partition which got ruined by mkfs.ext4 command jagsir Linux - General 6 09-19-2010 07:53 AM
I accidentally install the grub on the Windows partition, Can I reconstruct??? nadavvin Linux - General 10 10-25-2006 07:30 PM
Help needed to recover data from ext3 file system where mkfs was issued accidentally kapilsampath Linux - General 4 04-26-2005 07:52 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration