LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-20-2011, 04:15 AM   #1
JoeShearn
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Unhappy Recovering 1Tb ext3 with fsck.ext3


Hi,

Last night I was moving some files around. I Tarred and GZipped most of the data on one 1Tb partition and stuck the archives on a second 1Tb partition on a separate disk. I then proceeded to format the first partition with NTFS (from Linux.) The only problem is that I completely forgot that I had a CD drive and formatted sdc1 instead of sdd1! I began doing a full NTFS format and after a minute or two I cancelled it and decided to do a quick format. I then realized my mistake.

I managed to find a copy of the superblock and began trying to recover the disk. fsck -t ext3 recognized the partition as NTFS but I luckily didn't have fsck.ntfs installed so it didn't touch it. I managed to get it working with fsck.ext3 (with -b,-B and -y) fsck.ext3 didn't mind that it was an NTFS partition. I have a few questions:

Will this work?

Roughly how long will this take? It's running from Knoppix within a virtual machine to a USB hard drive which is 100% full. Days?

Being that for a few minutes I attempted a full format am I going to end up with a bunch of corrupted archives?

If I do end up with file corruption can anyone recommend a way of recovering the data / sorting it out?

Is it likely to be just a few old files that are corrupt (It's my understanding that filesystems like to keep files in the same area on the disk to minimize the amount of head travel.)

This might just be wishful thinking but as the filesystem fills up will ext3 put the newer files towards the end of the disk? If so then I'm hoping that a full NTFS format starts at the beginning of the disk.

Any help would be greatly appreciated,

Thanks,

Joe
 
Old 05-20-2011, 06:43 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Erk ... some answers, then some observations.

- fsck will work - FSVO "work". However, it is designed to fix filesystems - not (necessarily) files. You might be lucky with your files, maybe not - but you'll have a valid filesystem.
- it'll take forever on USB. I'd have found an internal connector for it.
- hopefully you'll get some useful data back.
- if they are corrupted, they are history.

Nothing should have been done against the "real disk". Image it off to another disk and faff around with that. If that also gets mangled, who cares - re-image and start again.
fsck with "-y" gives you no "out". What Ted decides to do as part of the tool is then cast in (digital) concrete.
A while back I tested formatting over an ext3 (probably with NTFS as it happens), and then used "mkfs.ext3 -S" and proceeded to check if the world still existed. It did; all files were still good - however this was a "new" filesystem with just a few files copied to it prior to the test.

Backups are the only real answer - and if you can accidentally stomp on it, it doesn't meet my definition of a backup.
 
Old 05-20-2011, 07:54 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I would try to use testdisk or foremost to carve whatever archives and files you can out of it. Testdisk might be able to recover partitions.
 
Old 05-20-2011, 10:20 AM   #4
JoeShearn
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for the advice. To install the hard drive internally I'll have to stop fsck and then start it again. Re-checking the partition won't cause any (more) damage will it?

Joe
 
Old 05-20-2011, 10:45 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Writing anything to the drive may cause damage, reading from the drive will not. I personally would NOT run fsck if you just formatted it with NTFS over ext3. Try testdisk first, and see if it can recover the partition.
 
Old 05-20-2011, 06:38 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Stopping fsck will possibly (probably) add to your problems - I would let it run now.
Then try the tools mentioned above - maybe add photorec to the list. They should have been used first, but can't be helped. Note that the recovery will likely take a while too.
 
Old 05-20-2011, 10:12 PM   #7
JoeShearn
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Good news! It was some how finished when I got home. It had only been running for about 16 hours. There are a lot of files and folders in the lost and found folder. They all have names like #1234567. The good news is that inside all of these folders everything is named correctly. I watched a TV episode and it didn't seem corrupted and I managed to extract a 6Gb tar.gz archive. I haven't confirmed the integrity of the files extracted from the archive but I assume that it would have failed whilst extracting if it was corrupt. df says that the drive is 68% full, it used to be 99% full but I think that I have most of my important files. When I finish shifting all this data around I'll have to extract some >100Gb archives so that will be the real test.

Thanks for all of the help everyone!

Joe
 
  


Reply

Tags
ext3, format, recover



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changed a Seagate 1TB external drive from ntfs to ext3 and dr. reverts to RO always bernieohare Linux - Hardware 10 03-04-2009 05:59 AM
Ext3 Filesystem overhead on a 1TB drive Lommer Linux - Newbie 7 03-20-2008 08:55 AM
fsck.ext3 help Kamenko Red Hat 1 10-04-2006 01:51 PM
recovering data from ext3 chupacabra Linux - General 2 10-21-2002 10:32 AM
fsck in ext3? recurrente Linux - Newbie 3 03-21-2002 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:16 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