LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2013, 02:42 AM   #1
astro.alireza
LQ Newbie
 
Registered: Feb 2013
Location: Iran - Tehran
Distribution: Fedora, Centos, Ubuntu
Posts: 1

Rep: Reputation: Disabled
Unhappy Recover Formatted Partition


Hi Friends
My VPS powers off without shutdown and after booting, it can't mount root partition because of file system errors.
I try to check file system with this command:
e2fsck -b <superblock> /dev/sda1
That I can find alternative "superblocks" with this command:
mke2fs -n /dev/sda1
But I made a mistake and run this:
mke2fs /dev/sda1
So my partition formatted and I lost my data.
Is there any solution for recovering partition with all of its directory and file names?
 
Old 07-19-2013, 05:43 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
It may be possible to find that data using Testdisk, if not you will have to go the Photorec route, which means recovering without directory structure and filenames.
 
1 members found this post helpful.
Old 07-19-2013, 06:25 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
I've had some success with "mke2fs -S ..." (capital S, read the manpage) after testing with mkfs.ntfs over a newly created ext3 filesystem. Had some test files in it, and all were recovered but it was a test system only - no fragmented files, nothing I cared about.

Take a backup, and try it
 
Old 07-19-2013, 06:58 AM   #4
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
The bad thing about e*fs is the superblocks always end up int he same place fior a same sized partition.

Make a backup of that partition if you have the space elsewhere, using dd or the like, and work off of that backup image. Try not to mess with the original partition too much or you decrease your chances of successful recovery.

As stated you can use photorec as a last resort. You'll lose all filename information, and your best results will come from known file types (those with metadata with specific headers, size information, etc). If you have any file types unknown to photorec, it won't do such a good job (although I think you can add file information via metadata, I've never tried it).
 
  


Reply



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
Recover Accidentally formatted encrypted raid partition pazzport Linux - Desktop 1 10-15-2010 03:49 AM
Recover formatted ext3 partition files mazzo Linux - General 9 07-02-2010 08:36 AM
Recover formatted EXT3 partition designator Linux - Software 10 03-29-2008 08:30 PM
Accidentally Formatted NTFS Partition... Looking to Recover Data Adam A Flynn Linux - Software 5 08-13-2006 11:59 AM
recover fat partition formatted with ext3 by error mermoz Linux - Newbie 3 05-31-2005 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:33 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration