LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-07-2010, 02:51 PM   #1
redmittens
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
Question Corrupted USB flash drive needs fixing (Fedora/Linpus)


Hi,

I unwisely lent my USB stick to a friend who desperately needed to copy some files between home and work. When she returned it, I plugged it in and found the files could not be read (I have a few things on there she was told not to delete). It appears to have become corrupted- can't say how it happened as I wasn't with her, though she was successful in using it (windows machines of some variety).

Output of ls is a succession of 'ls:cannot access <garbage> Input/output error' with the odd 'No such file or directory' interspersed between them.

I'd like to recover my files if possible, a few are latest versions and hence the backups aren't up to date.

I'm using an Acer Aspire one with the supplied Linpus linux (based on fedora 8), also have access to my old laptop and desktop with older versions of fedora on them.

On the Aspire one, kernel is 2.6.23.9lw

The usb drive is a 16GB Super-Talent (really small one) which mounts as /media/disk

Using fsck gives a response of:
fsck 1.40.2 (12-Jul-2007)
Checking all file systems.
[/sbin/fsck.ext2 (1) -- /] fsck.ext2 disk /dev/sda1

fsck.ext2 however results in:
e2fsck 1.40.2 (12-Jul-2007)
fsck.ext2: Is a directory while trying to open disk

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

I've read that using e2fsck on a mounted drive is a bad idea, so am looking for suggestions. I just want to recover the files (and am hoping I can then format the disk and make it useable again).

Any suggestions would be much appreciated. Thanks for your time.

Redmittens.
 
Old 01-07-2010, 03:05 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
If she successfully used it on Windows that would indicate that it's filesystem is probably FAT*, try using Windows data recovery tools eg. GetDataBack ...


cheers
 
Old 01-07-2010, 07:14 PM   #3
redmittens
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
My computers are all Linux, is there no way to recover data on a FAT filesystem without finding a windows machine?
 
Old 01-07-2010, 07:21 PM   #4
londy
LQ Newbie
 
Registered: Feb 2009
Distribution: openSUSE 11.4
Posts: 28

Rep: Reputation: 3
I've never used it before but I bookmarked this page, just in case, a few months ago:

http://www.cgsecurity.org/wiki/PhotoRec

Maybe it'll work??
 
Old 01-07-2010, 08:23 PM   #5
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You may be able to use forensic tools - eg. tct, foremost etc... try netsearching for 'file carving fat linux'

cheers
 
Old 01-07-2010, 08:46 PM   #6
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
Try to copy the whole filesystem to an image first then check the image with fsck.vfat or dosfsck.

Code:
dd if=/dev/sda1 of=image
dosfsck image
You might need additional options to dosfsck to make it check file images. Just do 'man dosfsck' to read its manual.

If it gets fixed, you can mount the image to somewhere with:
Code:
mount image /mnt/somewhere -o loop
You might also add -t vfat if that doesn't work.
 
Old 02-13-2010, 05:46 PM   #7
linux01
LQ Newbie
 
Registered: Aug 2005
Posts: 20

Rep: Reputation: 1
how about ....

Quote:
Originally Posted by konsolebox View Post
Try to copy the whole filesystem to an image first then check the image with fsck.vfat or dosfsck.

Code:
dd if=/dev/sda1 of=image
dosfsck image
You might need additional options to dosfsck to make it check file images. Just do 'man dosfsck' to read its manual.

If it gets fixed, you can mount the image to somewhere with:
Code:
mount image /mnt/somewhere -o loop
You might also add -t vfat if that doesn't work.
fdisk -l
this command will list all disks partitions and their types....
 
Old 02-14-2010, 12:06 PM   #8
jefro
Guru
 
Registered: Mar 2008
Posts: 11,013

Rep: Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356Reputation: 1356
You can try to get that data back but don't blame the person. Flash drives break that way more often than people wreck them.

In fact they were first sold as an almost unbreakable device. Just plug and play.

See this for ideas.

http://www.blackhat.com/presentation...-03-willis.pdf

Last edited by jefro; 02-14-2010 at 12:08 PM.
 
  


Reply

Tags
corrupted, drive, fix, flash, linpus, usb


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
Need help to install fedora 9 using USB flash drive ajujoseph Fedora - Installation 3 04-27-2012 03:27 AM
fedora 7: autofs is not mounting USB flash drive or DVD ROM drive Hewson Linux - General 3 05-12-2008 08:58 AM
how to mount usb flash drive in fedora? jvan Linux - Newbie 4 01-24-2008 03:12 AM
Need help for usb flash drive using Fedora 2 matrim Fedora 13 03-20-2007 10:10 PM
USB flash drive and Fedora Core 2 darkflounder Linux - Newbie 5 09-14-2004 01:50 AM


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