LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 04-02-2007, 07:03 PM   #1
the theorist
Member
 
Registered: Apr 2002
Distribution: Fedora Core 5 & 6
Posts: 47

Rep: Reputation: 15
Manual file system fixing with e2fsck -- are my files permanently lost?


So my Fedora Core 6 ext3 /home partition somehow got its superblock corrupted. I looked around a bit for common fixes and they don't work. This includes manually passing a backup superblock number to e2fsck. It only demands that you manually go through and make a decision on every little error it finds.

So, am I screwed? I'm not really sure what e2fsck is doing during the manual repair process. I let it overwrite some "broken" sectors. Then in the next repair stage, it named certain files that it wanted to clear. So I tried a few, and indeed, those files and directories were replaced by empty files. However many of the other files on this partition are still available.

I've been working on it using my Fedora Rescue CD. How should I go about fixing this problem? Of course I can just go and reformat the /home partition and/or reinstall the OS, but I'd rather not go to that extreme. Any better ideas, or comforting pointers? I've never had to mess with e2fsck manually before.

Thanks!
 
Old 04-02-2007, 08:23 PM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
e2fschk,

When it asks for your input usually means there is a un-recoverable problem. You can recover all data with a live CD from the /home partition using "photorec" (typed in a terminal), then re-install to save a couple weeks, and a couple years of your life expectancy by avoiding the stress.

Last edited by Junior Hacker; 04-02-2007 at 08:33 PM.
 
Old 04-02-2007, 08:26 PM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
I have a multi-boot, sometimes, when an OS can't access the /home partition, I boot up Mandrake, it reports a problem also, and fixes it.
 
Old 04-03-2007, 04:42 PM   #4
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Linux Mint 14
Posts: 272

Rep: Reputation: 30
Try only to mount the fs, without checking it:

mount -t ext2 -o ro,errors=continue,sb=163840 /dev/partition /mnt/something

sb number can be different, and quite surely is different.

ext2 is not a typo instead of ext3, i suggest you to use ext2 .

I don't understand if the hd is broken, or if it is only a filesystem problem.

And yes, photorec ( and also foremost, but i have found this less good at least with jpeg ) is a great tool.

Good luck.

Last edited by mtb; 04-03-2007 at 04:44 PM.
 
Old 04-03-2007, 09:42 PM   #5
the theorist
Member
 
Registered: Apr 2002
Distribution: Fedora Core 5 & 6
Posts: 47

Original Poster
Rep: Reputation: 15
I'd like to thank the LQ posters for replying!

Thanks for the pointer to photorec -- I had never heard of it, but it looks like a great tool (and included with Knoppix!) However I couldn't use it because I had files of many unsupported formats to try and save (my whole /home directory).

It was a filesystem problem. I don't know what happened, but apparently some of the blocks were inaccessible. e2fsck forced a manual check, and I let it go through and automatically answer 'yes' to every question so it rewrote the bad blocks.

Fortunately I was able to backup almost all of my files beforehand by using the Knoppix live cd and copying the relevant partition to a remote host with rsync. I wound up losing a few files, perhaps due to my first muddling attempt at fixing the problem, before I backed up.
 
Old 04-04-2007, 01:18 AM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Quote:
And yes, photorec ( and also foremost, but i have found this less good at least with jpeg ) is a great tool.
A couple weeks ago, I repaired a customer's computer, I chose to "move" their data back on their repaired system from my external drive instead of using my usual protocol, which is to "copy" it back and delete their data after delivering the unit and advising they back up. Something went wrong during the transfer and I deleted the partially filled folder from their computer, then went to try again only to find most of the data was gone off my drive because of the stupid move.

I used foremost 1.1 & 1.4 from source in different OS's, I used foremost 1.3 from repos in Debian Etch, and foremost 1.2 off the Helix Live CD, photorec off the Helix CD, and the latest scalpel from source in another older OS.
The foremost 1.3 from Debian repositories in Etch got the best results with 285 full size, and all thumbnails of the approximately 400 photos from their digital camera. The foremost 1.1 from source got all the thumbnails but only about 260 full size. The foremost 1.2 on the Helix CD only got the thumbnails (not sure which jpg line in foremost.conf I used though). The foremost 1.4 from source only got the full size, same with Photorec. Scalpel which is a re-vamp of foremost, only got about half the thumbnails.

Foremost has 3 to 4 different types of header/footer styles to use in the configuration file, the last one with no junk in between the header and footer produces the most. Of the 10GB dd image of the section of this FAT32 drive that had the photos, I usually got around 5GB of .jpg files with foremost, most were not readable, photorec would produce a text file representing these un readable .jpgs foremost produced.

I have a feeling the thumbnails are from the directory/folder they were in, and because I pulled another stupid move by adding 8GB of data to the drive before finding these tools, I may have overwritten some of the sectors of the last 115 or so full size. But because I got different results from different tools, I'm going to dig deeper with sleuthkit and hex editors (I envision smoke coming out of my ears), as I've read that some data may not be recovered by data carvers on fragmented drives. And this drive has not been de-fragmented, and is my backup drive which gets files written and deleted often.
Maybe I'll learn something digging deeper, maybe I'll burn something out.
 
  


Reply

Tags
fedora 6, fsck


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
umount & e2fsck on root file system (/) windycity_linux Linux - Newbie 2 03-09-2007 03:30 AM
Running fsck (or e2fsck) on root file system... xbill311x Linux - Newbie 2 01-02-2006 10:54 PM
file system problem? data lost Tinku Linux - General 3 11-26-2005 06:21 PM
Fixing File System Error on Debian Box doctorcisco Linux - Software 0 05-21-2004 03:36 PM
hd-problem files lost, strange e2fsck message inge_ninge Linux - Newbie 3 01-26-2003 11:45 AM


All times are GMT -5. The time now is 05:44 AM.

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