LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2010, 01:33 PM   #1
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
corrupt usb drive what to do?


I got a usb drive that doesn't work anymore. It loads fine but I can't mount it? The closest I got in finding a solution is to do

fsck.msdos -a /dev/sdb

But all I get



Code:
dosfsck 3.0.1, 23 Nov 2008, FAT32, LFN
Currently, only 1 or 2 FATs are supported, not 188.
What can I do?


edit:

when I plug it in
tail -f /var/log/messages

Code:
Aug 23 17:29:32 benylap kernel: [ 3149.721327] usb 1-1.5: new full speed USB device using uhci_hcd and address 6
Aug 23 17:29:32 benylap kernel: [ 3150.161276] usb 1-1.5: New USB device found, idVendor=1307, idProduct=0190
Aug 23 17:29:32 benylap kernel: [ 3150.161290] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 23 17:29:32 benylap kernel: [ 3150.161299] usb 1-1.5: Product: USB Mass Storage Device
Aug 23 17:29:32 benylap kernel: [ 3150.161306] usb 1-1.5: Manufacturer: USBest Technology
Aug 23 17:29:32 benylap kernel: [ 3150.161313] usb 1-1.5: SerialNumber: 090627A400103D
Aug 23 17:29:32 benylap kernel: [ 3150.161595] usb 1-1.5: configuration #1 chosen from 1 choice
Aug 23 17:29:32 benylap kernel: [ 3150.172621] scsi5 : SCSI emulation for USB Mass Storage devices
Aug 23 17:29:37 benylap kernel: [ 3155.176859] scsi 5:0:0:0: Direct-Access     Ut190    USB2FlashStorage 0.00 PQ: 0 ANSI: 2
Aug 23 17:29:37 benylap kernel: [ 3155.179809] scsi 5:0:0:1: Direct-Access     Ut190    SD0StorageDevice 0.00 PQ: 0 ANSI: 2
Aug 23 17:29:37 benylap kernel: [ 3155.189034] sd 5:0:0:0: Attached scsi generic sg2 type 0
Aug 23 17:29:37 benylap kernel: [ 3155.190880] sd 5:0:0:1: Attached scsi generic sg3 type 0
Aug 23 17:29:37 benylap kernel: [ 3155.198823] sd 5:0:0:0: [sdb] 15794176 512-byte logical blocks: (8.08 GB/7.53 GiB)
Aug 23 17:29:37 benylap kernel: [ 3155.208791] sd 5:0:0:0: [sdb] Write Protect is off
Aug 23 17:29:37 benylap kernel: [ 3155.213789] sd 5:0:0:1: [sdc] Attached SCSI removable disk
Aug 23 17:29:37 benylap kernel: [ 3155.230767]  sdb: unknown partition table
Aug 23 17:29:38 benylap kernel: [ 3156.105759] sd 5:0:0:0: [sdb] Attached SCSI removable disk
Maybe the partition table is corrupt?

Last edited by Four; 08-24-2010 at 01:44 PM.
 
Old 08-24-2010, 02:51 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Use fdisk to create a new partition table.
Code:
[root@kids ~]# fdisk /dev/sdb

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):p

Disk /dev/sdb: 8119 MB, 8119648256 bytes
255 heads, 63 sectors/track, 987 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         383     3076416    b  W95 FAT32
/dev/sdb2             384         987     4851630   83  Linux

Command (m for help):
At this stage you can choose to delete a partition or both partitions, then create new ones of the desired type.

Last edited by smoker; 08-24-2010 at 02:54 PM.
 
Old 08-24-2010, 05:22 PM   #3
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
won't I loose all my data?
 
Old 08-24-2010, 05:50 PM   #4
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 17.0 at present.
Posts: 1,167

Rep: Reputation: 201Reputation: 201Reputation: 201
As per Smoker...
What do you get when you print out the partition table? Smoker's example shows W95 FAT32 and Linux, what do you get? It looks like yours is corrupt (as below) You can re-write the partition ID to change/reset the partition type - option 't'.

Code:
Aug 23 17:29:37 benylap kernel: [ 3155.198823] sd 5:0:0:0: [sdb] 15794176 512-byte logical blocks: (8.08 GB/7.53 GiB)
Aug 23 17:29:37 benylap kernel: [ 3155.208791] sd 5:0:0:0: [sdb] Write Protect is off
Aug 23 17:29:37 benylap kernel: [ 3155.213789] sd 5:0:0:1: [sdc] Attached SCSI removable disk
Aug 23 17:29:37 benylap kernel: [ 3155.230767]  sdb: unknown partition table
Aug 23 17:29:38 benylap kernel: [ 3156.105759] sd 5:0:0:0: [sdb] Attached SCSI removable disk
If you repartition the disk you've probably lost any data so try the ID first.

Play Bonny!
 
Old 08-24-2010, 07:06 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Quote:
Originally Posted by Four View Post
won't I loose all my data?
If you delete the partitions, yes. But you can still have a look first. You have no access to the data anyway do you ? It would be informative to know whether there are any partitions on the drive anyway. Trying to mount /dev/sdb won't work if it's partitioned into sdb1 and sdb2, so print the partition table and let's see what we're working with.
 
Old 08-24-2010, 08:34 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Might try ultimate boot cd tools on it. It has been able to find some of my stuff before. Then if you can get your data off then run some diags on it. Start with smart tools maybe.
 
Old 08-24-2010, 08:52 PM   #7
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 402

Rep: Reputation: 51
Quote:
won't I loose all my data?
Create a backup (in your case raw image) of your drive before doing any changes to it.
 
Old 08-25-2010, 12:03 PM   #8
Hidden Windshield
Member
 
Registered: Jul 2010
Distribution: Fedora
Posts: 65

Rep: Reputation: 26
Quote:
Originally Posted by Four View Post
won't I loose all my data?
Actually, no. Deleting a partition only changes the partition table, not the actual data. So, if you delete a partition, then create a partition at the same starting point and with the same size, the new partition will have all the data the old one did. This is actually part of the recommended technique for resizing partitions.

Having said that, I agree with 10110111 that you should make a raw image of the drive before you start messing with it. If you accidentally create a partition that overlaps your data, then write anything to it, you will lose data.
 
Old 09-02-2010, 11:42 AM   #9
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
Duplicate

Last edited by Four; 09-02-2010 at 11:44 AM.
 
Old 09-02-2010, 11:42 AM   #10
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
so here is what I get when I print partition table

Code:
Command (m for help): p

Disk /dev/sdb: 8086 MB, 8086618112 bytes
249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d31d3

   Device Boot      Start         End      Blocks   Id  System
No partitions is detected. And gparted tells me I should create a new partition table.

I created a raw backup using dd.

I went back to fdisk. Pressed n and created a new partition. And now it looks like this. There should be 2 partitions but I only care about the Fat32 one.

Code:
Command (m for help): p

Disk /dev/sdb: 8086 MB, 8086618112 bytes
18 heads, 48 sectors/track, 18280 cylinders
Units = cylinders of 864 * 512 = 442368 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d31d3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       18281     7897057    b  W95 FAT32
I did a hex dump here are some interesting parts

This looks like its part of a filesystem. I don't know how to tell what kind. And it keeps repeating. Not byte for byte but similar structure.
Code:
0078fe80  21 00 00 00 22 00 00 00  23 00 00 00 24 00 00 00  |!..."...#...$...|
0078fe90  25 00 00 00 26 00 00 00  27 00 00 00 28 00 00 00  |%...&...'...(...|
0078fea0  29 00 00 00 2a 00 00 00  2b 00 00 00 2c 00 00 00  |)...*...+...,...|
0078feb0  2d 00 00 00 2e 00 00 00  2f 00 00 00 30 00 00 00  |-......./...0...|
0078fec0  31 00 00 00 32 00 00 00  33 00 00 00 34 00 00 00  |1...2...3...4...|
0078fed0  35 00 00 00 36 00 00 00  37 00 00 00 38 00 00 00  |5...6...7...8...|
0078fee0  39 00 00 00 3a 00 00 00  3b 00 00 00 3c 00 00 00  |9...:...;...<...|
0078fef0  3d 00 00 00 3e 00 00 00  3f 00 00 00 40 00 00 00  |=...>...?...@...|
0078ff00  41 00 00 00 42 00 00 00  43 00 00 00 44 00 00 00  |A...B...C...D...|
0078ff10  45 00 00 00 46 00 00 00  47 00 00 00 48 00 00 00  |E...F...G...H...|
0078ff20  49 00 00 00 4a 00 00 00  4b 00 00 00 4c 00 00 00  |I...J...K...L...|
0078ff30  4d 00 00 00 4e 00 00 00  4f 00 00 00 50 00 00 00  |M...N...O...P...|
0078ff40  51 00 00 00 52 00 00 00  53 00 00 00 54 00 00 00  |Q...R...S...T...|
0078ff50  55 00 00 00 56 00 00 00  57 00 00 00 58 00 00 00  |U...V...W...X...|
0078ff60  59 00 00 00 5a 00 00 00  5b 00 00 00 5c 00 00 00  |Y...Z...[...\...|
0078ff70  5d 00 00 00 5e 00 00 00  5f 00 00 00 60 00 00 00  |]...^..._...`...|
0078ff80  61 00 00 00 62 00 00 00  63 00 00 00 64 00 00 00  |a...b...c...d...|
0078ff90  65 00 00 00 66 00 00 00  67 00 00 00 68 00 00 00  |e...f...g...h...|
0078ffa0  69 00 00 00 6a 00 00 00  6b 00 00 00 6c 00 00 00  |i...j...k...l...|
0078ffb0  6d 00 00 00 6e 00 00 00  6f 00 00 00 70 00 00 00  |m...n...o...p...|
0078ffc0  71 00 00 00 72 00 00 00  73 00 00 00 74 00 00 00  |q...r...s...t...|
0078ffd0  75 00 00 00 76 00 00 00  77 00 00 00 78 00 00 00  |u...v...w...x...|
0078ffe0  79 00 00 00 7a 00 00 00  7b 00 00 00 7c 00 00 00  |y...z...{...|...|
0078fff0  7d 00 00 00 7e 00 00 00  7f 00 00 00 80 00 00 00  |}...~...........|
Yes after a while I get this:

Code:
00f14e00  3c 6d 65 64 69 61 77 69  6b 69 20 78 6d 6c 6e 73  |<mediawiki xmlns|
00f14e10  3d 22 68 74 74 70 3a 2f  2f 77 77 77 2e 6d 65 64  |="http://www.med|
00f14e20  69 61 77 69 6b 69 2e 6f  72 67 2f 78 6d 6c 2f 65  |iawiki.org/xml/e|
00f14e30  78 70 6f 72 74 2d 30 2e  33 2f 22 20 78 6d 6c 6e  |xport-0.3/" xmln|
00f14e40  73 3a 78 73 69 3d 22 68  74 74 70 3a 2f 2f 77 77  |s:xsi="http://ww|
00f14e50  77 2e 77 33 2e 6f 72 67  2f 32 30 30 31 2f 58 4d  |w.w3.org/2001/XM|
00f14e60  4c 53 63 68 65 6d 61 2d  69 6e 73 74 61 6e 63 65  |LSchema-instance|
00f14e70  22 20 78 73 69 3a 73 63  68 65 6d 61 4c 6f 63 61  |" xsi:schemaLoca|
00f14e80  74 69 6f 6e 3d 22 68 74  74 70 3a 2f 2f 77 77 77  |tion="http://www|
00f14e90  2e 6d 65 64 69 61 77 69  6b 69 2e 6f 72 67 2f 78  |.mediawiki.org/x|
00f14ea0  6d 6c 2f 65 78 70 6f 72  74 2d 30 2e 33 2f 20 68  |ml/export-0.3/ h|
00f14eb0  74 74 70 3a 2f 2f 77 77  77 2e 6d 65 64 69 61 77  |ttp://www.mediaw|
00f14ec0  69 6b 69 2e 6f 72 67 2f  78 6d 6c 2f 65 78 70 6f  |iki.org/xml/expo|
00f14ed0  72 74 2d 30 2e 33 2e 78  73 64 22 20 76 65 72 73  |rt-0.3.xsd" vers|
00f14ee0  69 6f 6e 3d 22 30 2e 33  22 20 78 6d 6c 3a 6c 61  |ion="0.3" xml:la|
00f14ef0  6e 67 3d 22 65 6e 22 3e  0a 20 20 3c 73 69 74 65  |ng="en">.  <site|
That looks like a file I put on the usb on the fat32 file system. So it must be the first partition

Last edited by Four; 09-02-2010 at 11:44 AM.
 
Old 09-03-2010, 02:19 AM   #11
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
I found volume label. And it seems reasonable. I checked a bit from here

http://en.wikipedia.org/wiki/File_Allocation_Table

See directory table section. And I gave the drive a volume label of "keytone" I found its starting address . And I see the directory file names also the bit for Volume label is set for "keytone" as it should. But before the volume label and stuff its all a bunch of zero's.

It starts at address 0x00F13E00. ... And I'm still trying to recover the data.

I'm going to try to format my USB FAT32 and at address 0x00F13E00 copy over a few megs into the USB from the backup image and maybe it'll work.

Any ideas is appreciated.
 
  


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
Corrupt files on USB flash drive won't delete!! Indy452 Linux - General 13 04-29-2010 09:03 AM
USB Flash Drive Problem - possibly corrupt?? dh4 Linux - Hardware 4 12-25-2009 10:51 AM
Corrupt drive sab0tage Linux - Hardware 4 02-08-2007 05:45 PM
Could Linux corrupt usb drive??? melinda_sayang Linux - Hardware 5 12-07-2004 12:58 PM


All times are GMT -5. The time now is 08:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration