On 24.07.2016 07:07, Andrei Borzenkov wrote:
Rewriting single block in question should do it. As you can read from
raw device and have both physical and logical block address something like

dd if=/dev/sdd1 skip=222940168 count=8 | dd of=/path/to/dysk/dysk.bin
seek=189669768 conv=notrunc count=8

Thank you for the one-liner, I thought of doing it myself before, but when I tried to figure out which numbers mean what in scrub messages, I got a bit lost.

However, this one-liner doesn't seem to work here; `dd` prints:

#v+
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 5.2857e-05 s, 77.5 MB/s
dd: writing to ‘/media/liori/USB/dysk/dysk.bin’: Input/output error
1+0 records in
0+0 records out
0 bytes (0 B) copied, 0.00364222 s, 0.0 kB/s
#v-


I'm not sure what would this message mean in this case. Is btrfs reading the block before writing? Maybe some block blacklist stored somewhere (I see that the corruption counter in scrub messages go up even if it reports the same errors in subsequent runs)?


If you have possibility to verify file content(s), this technique can be
used to read over unreadable parts of file by combining multiple dd's
from file and device.

Some of the files stored in this `dysk/dysk.bin` disk image have some internal checksums (zip archives, etc.). That includes the ones hit by the checksum error. I'll try verifying these later.



--
Tomasz Melcer
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to