Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to save this Flash drive?

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

How to save this Flash drive?

#1 Post by hack3rcon »

Hello,
I have a flash drive that I can't copy files from it because it detached suddenly. How can I solve it?
I tried and got below result:

Code: Select all

$ sudo ddrescue -n -v -T 30 --min-read-rate=50k /dev/sdc1 image.dd
GNU ddrescue 1.23
About to copy 32237 MBytes from '/dev/sdc1' to 'image.dd'
    Starting positions: infile = 0 B,  outfile = 0 B
    Copy block size: 128 sectors       Initial skip size: 1954 sectors
Sector size: 512 Bytes

Press Ctrl-C to interrupt
     ipos:    2798 MB, non-trimmed:    7595 kB,  current rate:    147 kB/s
     opos:    2798 MB, non-scraped:        0 B,  average rate:    287 kB/s
non-tried:   32213 MB,  bad-sector:        0 B,    error rate:   7595 kB/s
  rescued:   15810 kB,   bad areas:        0,        run time:         54s
pct rescued:    0.04%, read errors:      281,  remaining time:  1d 16h 54m
 slow reads:        0,        time since last successful read:         n/a
Copying non-tried blocks... Pass 1 (forwards)
ddrescue: Input file disappeared: No such file or directory
And:

Code: Select all

$ sudo safecopy /dev/sdc1 out -M CoRrUpTeD
Low level device calls enabled mode: 1
Reported hw blocksize: 4096
Reported low level blocksize: 4096
Filesize not reported by stat(), trying seek().
File size: 32237420544
Blocksize: 4096
Fault skip blocksize: 65536
Resolution: 4096
Min read attempts: 3
Head moves on read error: 1
Marker string: CoRrUpTeD
Starting block: 0
Source: /dev/sdc
Destination: out
......!*** buffer overflow detected ***: safecopy terminated
Aborted
https://imgur.com/dTAfVHa
Thank you.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: How to save this Flash drive?

#2 Post by pylkko »

What does the kernel log say when it detaches?

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: How to save this Flash drive?

#3 Post by hack3rcon »

pylkko wrote:What does the kernel log say when it detaches?
Is you mean the output of "dmsg" command?

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: How to save this Flash drive?

#4 Post by pylkko »

yes, but logs in general might contain something useful

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: How to save this Flash drive?

#5 Post by pcalvert »

Were you able to successfully copy the entire partition using ddrescue? And what is the filesystem on that partition?

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: How to save this Flash drive?

#6 Post by hack3rcon »

pylkko wrote:yes, but logs in general might contain something useful
The log is:

Code: Select all

$ sudo dmesg
[30547.621717] usb 2-8: device descriptor read/64, error -110
[30547.857754] usb 2-8: reset high-speed USB device number 36 using xhci_hcd
[30547.985787] usb 2-8: device descriptor read/64, error -71
[30548.221767] usb 2-8: device descriptor read/64, error -71
[30548.457760] usb 2-8: reset high-speed USB device number 36 using xhci_hcd
[30548.457870] usb 2-8: Device not responding to setup address.
[30548.665823] usb 2-8: Device not responding to setup address.
[30548.873709] usb 2-8: device not accepting address 36, error -71
[30549.001740] usb 2-8: reset high-speed USB device number 36 using xhci_hcd
[30549.001878] usb 2-8: Device not responding to setup address.
[30549.209837] usb 2-8: Device not responding to setup address.
[30549.417705] usb 2-8: device not accepting address 36, error -71
[30549.417834] usb 2-8: USB disconnect, device number 36
[30549.417863] sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_TIME_OUT driverbyte=DRIVER_OK
[30549.417869] sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 78 c0 00 00 01 00
[30549.417872] print_req_error: I/O error, dev sdc, sector 30912
[30549.417954] sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[30549.417961] sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 78 c1 00 00 1f 00
[30549.417964] print_req_error: I/O error, dev sdc, sector 30913
[30549.417988] print_req_error: I/O error, dev sdc, sector 30914
[30549.418009] print_req_error: I/O error, dev sdc, sector 30912
[30549.418026] FAT-fs (sdc1): Directory bread(block 30816) failed
[30549.418069] print_req_error: I/O error, dev sdc, sector 30913
[30549.418090] FAT-fs (sdc1): Directory bread(block 30817) failed
[30549.418109] print_req_error: I/O error, dev sdc, sector 30914
[30549.418119] FAT-fs (sdc1): Directory bread(block 30818) failed
[30549.418133] print_req_error: I/O error, dev sdc, sector 30915
[30549.418139] FAT-fs (sdc1): Directory bread(block 30819) failed
[30549.418146] print_req_error: I/O error, dev sdc, sector 30916
[30549.418151] FAT-fs (sdc1): Directory bread(block 30820) failed
[30549.418157] print_req_error: I/O error, dev sdc, sector 30917
[30549.418162] FAT-fs (sdc1): Directory bread(block 30821) failed
[30549.418169] print_req_error: I/O error, dev sdc, sector 30918
[30549.418173] FAT-fs (sdc1): Directory bread(block 30822) failed
[30549.418183] FAT-fs (sdc1): Directory bread(block 30823) failed
[30549.418192] FAT-fs (sdc1): Directory bread(block 30824) failed
[30549.418201] FAT-fs (sdc1): Directory bread(block 30825) failed
[30549.418352] FAT-fs (sdc1): error, corrupted directory (invalid entries)
[30549.418354] FAT-fs (sdc1): Filesystem has been set read-only
[30549.418404] Buffer I/O error on dev sdc1, logical block 32, lost async page write
[30549.418462] Buffer I/O error on dev sdc1, logical block 15408, lost async page write
[30549.418576] Buffer I/O error on dev sdc1, logical block 1, lost async page write
[30549.605719] usb 2-8: new high-speed USB device number 37 using xhci_hcd
[30549.733815] usb 2-8: device descriptor read/64, error -71
[30549.969749] usb 2-8: device descriptor read/64, error -71
[30550.205700] usb 2-8: new high-speed USB device number 38 using xhci_hcd
[30550.333751] usb 2-8: device descriptor read/64, error -71
[30550.569708] usb 2-8: device descriptor read/64, error -71
[30550.677717] usb usb2-port8: attempt power cycle
[30551.329689] usb 2-8: new high-speed USB device number 39 using xhci_hcd
[30551.329795] usb 2-8: Device not responding to setup address.
[30551.537784] usb 2-8: Device not responding to setup address.
[30551.745651] usb 2-8: device not accepting address 39, error -71
[30551.873695] usb 2-8: new high-speed USB device number 40 using xhci_hcd
[30551.873832] usb 2-8: Device not responding to setup address.
[30552.081858] usb 2-8: Device not responding to setup address.
[30552.289702] usb 2-8: device not accepting address 40, error -71
[30552.289749] usb usb2-port8: unable to enumerate USB device

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: How to save this Flash drive?

#7 Post by hack3rcon »

pcalvert wrote:Were you able to successfully copy the entire partition using ddrescue? And what is the filesystem on that partition?

Phil
Not matter.

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: How to save this Flash drive?

#8 Post by hack3rcon »

Any idea?

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: How to save this Flash drive?

#9 Post by pcalvert »

hack3rcon wrote: Not matter.
^^^ This answer led me to believe that the problem was solved (or you gave up). Why does it not matter?

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

hack3rcon
Posts: 746
Joined: 2015-02-16 09:54
Has thanked: 48 times

Re: How to save this Flash drive?

#10 Post by hack3rcon »

pcalvert wrote:
hack3rcon wrote: Not matter.
^^^ This answer led me to believe that the problem was solved (or you gave up). Why does it not matter?

Phil
Because, I got the same error.

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: How to save this Flash drive?

#11 Post by pcalvert »

hack3rcon wrote:
pcalvert wrote:
hack3rcon wrote: Not matter.
^^^ This answer led me to believe that the problem was solved (or you gave up). Why does it not matter?

Phil
Because, I got the same error.
Please answer these questions using at least one whole sentence, and with no important details left out:
pcalvert wrote:Were you able to successfully copy the entire partition using ddrescue? And what is the filesystem on that partition?
Added question:
Have you tried using a different computer?

Phil
Last edited by pcalvert on 2020-08-30 07:10, edited 1 time in total.
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: How to save this Flash drive?

#12 Post by cuckooflew »

Were you able to successfully copy the entire partition using ddrescue?
Is easy to answer, it is a yes or no question.
And what is the filesystem on that partition?
Is clear, it would even translate clearly in a translator. But since the flash drive is corrupted, maybe it is not possible to know what the file system is on that partition, however if the flash drive is the OP's, one would think they know what file system is on it.
How ever, this particular entity is not likely to give a straight forward response, it has exhibited bot like behaviour in many of it's other posts, but of course denies being a bot,..in any event, you might want to review all the posts made by hack3rcon and then if you still want to continue, all I can say is Good Luck !
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: How to save this Flash drive?

#13 Post by pcalvert »

Most flash drives have a FAT32 filesystem. So if you didn't reformat it with a new filesystem, the file system on that flash drive is most likely FAT32.

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: How to save this Flash drive?

#14 Post by cuckooflew »

Also, the life of a flash drive is NOT eternal, sometimes it is best to just accept reality , and get a new one. It is also wise to keep a back up/copy of the one with important data, update the backup regularly , so when the old flash drive fails, and they inevitably do , when it fails , you have a copy of it. They usually do not give any warning before failing.
Post by hack3rcon » 2020-08-01 08:45
Hello,
I have a flash drive that I can't copy files from it because it detached suddenly.
This is perhaps the most common cause of a "premature death", of the flash drive.
I learned my lesson when one of mine got "pulled", by accident, and I never was able to get it to work again. I did manage to get most of the data off of it, but I consider myself lucky on that. maybe it wasn't just luck : 'ddrescue' was my friend, :

Code: Select all

man ddrescue
:DDRESCUE(1)                      User Commands                     DDRESCUE(1)

NAME
       ddrescue - data recovery tool

SYNOPSIS
       ddrescue [options] infile outfile [mapfile]

DESCRIPTION
       GNU ddrescue is a data recovery tool. It copies data from one file or
       block device (hard disc, cdrom, etc) to another, trying to rescue the
       good parts first in case of read errors.

       Always use a mapfile unless you know you won't need it. Without a
       mapfile, ddrescue can't resume a rescue, only reinitiate it. Be careful
       to not specify by mistake an old mapfile from an unrelated rescue.

       NOTE: In versions of ddrescue prior to 1.20 the mapfile was called
       'logfile'. The format is the same; only the name has changed.

       If you reboot, check the device names before restarting ddrescue.
       Don't use options '-F' or '-G' without reading the manual first : 
'
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: How to save this Flash drive?

#15 Post by Bulkley »

cuckooflew wrote:Also, the life of a flash drive is NOT eternal, sometimes it is best to just accept reality , and get a new one.
True but you reminded me . . . Years ago I lost a USB stick. A couple days later I found it on our garage floor in a puddle of water. Yes, I had driven over it. It was in pieces but the little circuit board was intact. I dried it out and reassembled it using tape to hold it together. It worked and I still use it.

Nobody here will want to read this but I have often found that the easiest way to rehabilitate a flash drive is to stick it into a Windows machine and do a quick format. Of course I lose any info on it but I don't use flash drives for secure storage.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: How to save this Flash drive?

#16 Post by cuckooflew »

That is kind of amazing, but possible,....
but I have often found that the easiest way to rehabilitate a flash drive is to stick it into a Windows machine and do a quick format.
If you have a windows machine handy, yes that would be a easy way, Freedos, as well, I use that, and it is a simple command/process:

Code: Select all

format d: [options] 
For the options: http://wiki.freedos.org/wiki/index.php/Format
I keep a "Live"bootable usb stick handy, it has Freedos on it, that is what is booted. also some Unix , linux , and BSD utilities on it as well.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: How to save this Flash drive?

#17 Post by pcalvert »

I just thought about how you may be able to recover the data (or some of it) from that flash drive.

First of all, make sure that your system is configured to NOT mount removable drives when they are inserted.


Here are the steps:

1. Create a working directory:

Code: Select all

mkdir sdc1_recovery
2. Change to the recovery directory:

Code: Select all

cd sdc1_recovery
3. Insert the flash drive.

4. Start recovery using ddrescue:

Code: Select all

sudo ddrescue -n -v -T 30 --min-read-rate=50k /dev/sdc1 sdc1-image sdc1-recovery-log
The drive will probably disconnect again. That's fine. Remove the flash drive and try again tomorrow, starting at step 2. If you don't want to wait until tomorrow, wait at least an hour before trying again. Keep repeating the process until as much of the data is recovered as possible.

Note: Do NOT delete any of the files in the recovery directory. Ddrescue will continue where it left off. Also, do not omit the recovery log file; it is essential.


You may need to follow that up with a different ddrescue command, depending on how successful you are at recovering the data. Please keep us updated regarding your progress.


Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Post Reply