Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] USB crucial file recovery
Date: Tue, 30 Aug 2016 00:40:58
Message-Id: CAN0CFw0H7J-MxUCTbS3vU3oEFTE0o2iFF5w_NXH0kPintrMfyA@mail.gmail.com
In Reply to: Re: [gentoo-user] USB crucial file recovery by "J. Roeleveld"
1 >>>> I have a USB stick with a crucial file on it (and only an old backup
2 >>>> elsewhere). It's formatted NTFS because I wanted to be able to open
3 >>>> the file on various Gentoo systems and my research indicated that
4 >>NTFS
5 >>>> was the best solution.
6 >>>>
7 >>>> I decided to copy a 10GB file from a USB hard disk directly to the
8 >>USB
9 >>>> stick this morning and I ran into errors so I canceled the operation
10 >>>> and now the file manager (thunar) has been stuck for well over an
11 >>hour
12 >>>> and I'm getting errors like these over and over:
13 >>>>
14 >>>> [ 2794.535814] Buffer I/O error on dev sdc1, logical block 2134893,
15 >>>> lost async page write
16 >>>> [ 2794.535819] Buffer I/O error on dev sdc1, logical block 2134894,
17 >>>> lost async page write
18 >>>> [ 2794.535822] Buffer I/O error on dev sdc1, logical block 2134895,
19 >>>> lost async page write
20 >>>> [ 2794.535824] Buffer I/O error on dev sdc1, logical block 2134896,
21 >>>> lost async page write
22 >>>> [ 2794.535826] Buffer I/O error on dev sdc1, logical block 2134897,
23 >>>> lost async page write
24 >>>> [ 2794.535828] Buffer I/O error on dev sdc1, logical block 2134898,
25 >>>> lost async page write
26 >>>> [ 2794.535830] Buffer I/O error on dev sdc1, logical block 2134899,
27 >>>> lost async page write
28 >>>> [ 2794.535832] Buffer I/O error on dev sdc1, logical block 2134900,
29 >>>> lost async page write
30 >>>> [ 2794.535835] Buffer I/O error on dev sdc1, logical block 2134901,
31 >>>> lost async page write
32 >>>> [ 2794.535837] Buffer I/O error on dev sdc1, logical block 2134902,
33 >>>> lost async page write
34 >>>> [ 2842.568843] sd 9:0:0:0: [sdc] tag#0 FAILED Result:
35 >>>> hostbyte=DID_ERROR driverbyte=DRIVER_SENSE
36 >>>> [ 2842.568849] sd 9:0:0:0: [sdc] tag#0 Sense Key : Hardware Error
37 >>[current]
38 >>>> [ 2842.568852] sd 9:0:0:0: [sdc] tag#0 Add. Sense: No additional
39 >>sense
40 >>>> information
41 >>>> [ 2842.568857] sd 9:0:0:0: [sdc] tag#0 CDB: Write(10) 2a 00 01 04 a4
42 >>>> 58 00 00 f0 00
43 >>>> [ 2842.568859] blk_update_request: I/O error, dev sdc, sector
44 >>17081432
45 >>>> [ 2842.568862] buffer_io_error: 20 callbacks suppressed
46 >>>>
47 >>>> nmon says sdc is 100% busy but doesn't show any reading or writing.
48 >>I
49 >>>> once pulled the USB stick in a situation like this and I ended up
50 >>>> having to reformat it which I need to avoid this time since the file
51 >>>> is crucial. What should I do?
52 >>>>
53 >>>> - Grant
54 >>>
55 >>> Whatever you do, do NOT try to unplug the USB you were writing to
56 >>unless you
57 >>> first manage to successfully unmount it. If you do pull the USB
58 >>stick
59 >>> regardless of its current I/O state you will likely corrupt whatever
60 >>file you
61 >>> were writing onto, or potentially more.
62 >>>
63 >>> You could well have a hardware failure here, which manifested itself
64 >>during
65 >>> your copying operation. Things you could try:
66 >>>
67 >>> Run lsof to find out which process is trying to access the USB fs and
68 >>kill it.
69 >>> Then see if you can remount it read-only.
70 >>>
71 >>> Run dd, dcfldd, ddrescue to make an image of the complete USB stick
72 >>on your
73 >>> hard drive and then try to recover any lost files with testdisk.
74 >>>
75 >>> Use any low level recovery tools the manufacturer may offer - they
76 >>will likely
77 >>> require MSWindows.
78 >>>
79 >>> Shut down your OS and disconnect the USB stick, then reboot and try
80 >>again to
81 >>> access it, although I would first create an image of the device using
82 >>any of
83 >>> the above tools.
84 >>
85 >>
86 >>dd errored and lsof returned no output at all so I tried to reboot but
87 >>even that hung after the first 2 lines of output so I did a hard reset
88 >>after waiting an hour or so. Once it came back up I tried to do 'dd
89 >>if=/dev/sdb1 of=usbstick' but I got this after awhile:
90 >>
91 >>dd: error reading ‘/dev/sdb1’: Input/output error
92 >>16937216+0 records in
93 >>16937216+0 records out
94 >>8671854592 bytes (8.7 GB) copied, 230.107 s, 37.7 MB/s
95 >>
96 >>It's a 64GB USB stick. dmesg says:
97 >>
98 >>[ 744.729873] sd 8:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK
99 >>driverbyte=DRIVER_SENSE
100 >>[ 744.729879] sd 8:0:0:0: [sdb] tag#0 Sense Key : Medium Error
101 >>[current]
102 >>[ 744.729883] sd 8:0:0:0: [sdb] tag#0 Add. Sense: Unrecovered read
103 >>error
104 >>[ 744.729886] sd 8:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 01 02 78 e0
105 >>00 00 f0 00
106 >>[ 744.729889] blk_update_request: critical medium error, dev sdb,
107 >>sector 16939232
108 >>[ 744.763468] sd 8:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK
109 >>driverbyte=DRIVER_SENSE
110 >>[ 744.763472] sd 8:0:0:0: [sdb] tag#0 Sense Key : Medium Error
111 >>[current]
112 >>[ 744.763474] sd 8:0:0:0: [sdb] tag#0 Add. Sense: Unrecovered read
113 >>error
114 >>[ 744.763478] sd 8:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 01 02 79 00
115 >>00 00 04 00
116 >>[ 744.763480] blk_update_request: critical medium error, dev sdb,
117 >>sector 16939264
118 >>[ 744.763482] Buffer I/O error on dev sdb1, logical block 4234304,
119 >>async page read
120 >>[ 744.786743] sd 8:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK
121 >>driverbyte=DRIVER_SENSE
122 >>[ 744.786747] sd 8:0:0:0: [sdb] tag#0 Sense Key : Medium Error
123 >>[current]
124 >>[ 744.786750] sd 8:0:0:0: [sdb] tag#0 Add. Sense: Unrecovered read
125 >>error
126 >>[ 744.786753] sd 8:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 01 02 79 04
127 >>00 00 04 00
128 >>[ 744.786755] blk_update_request: critical medium error, dev sdb,
129 >>sector 16939268
130 >>[ 744.786758] Buffer I/O error on dev sdb1, logical block 4234305,
131 >>async page read
132 >>
133 >>I haven't tried to mount it yet. Any suggestions?
134 >>
135 >>- Grant
136 >
137 > Try ddrescue.
138 > It tries to skip the really bad parts.
139 >
140 > Then try data recovery on copies of the resulting image file.
141
142
143 I did:
144
145 # ddrescue -d -r3 /dev/sdb usb.img usb.log
146 GNU ddrescue 1.20
147 Press Ctrl-C to interrupt
148 rescued: 62742 MB, errsize: 32768 B, current rate: 0 B/s
149 ipos: 8672 MB, errors: 1, average rate: 14878 kB/s
150 opos: 8672 MB, run time: 1h 10m 17s, remaining time: n/a
151 time since last successful read: 5s
152
153 # mount -o loop,ro usb.img /mnt/usbstick
154 mount: wrong fs type, bad option, bad superblock on /dev/loop0,
155 missing codepage or helper program, or other error
156
157 In some cases useful info is found in syslog - try
158 dmesg | tail or so.
159
160 # mount -o loop,ro -t ntfs usb.img /mnt/usbstick
161 NTFS signature is missing.
162 Failed to mount '/dev/loop0': Invalid argument
163 The device '/dev/loop0' doesn't seem to have a valid NTFS.
164 Maybe the wrong device is used? Or the whole disk instead of a
165 partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
166
167 How else can I get my file from the ddrescue image of the USB stick?
168
169 - Grant

Replies

Subject Author
Re: [gentoo-user] USB crucial file recovery Grant <emailgrant@×××××.com>