bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ddrescue] Feature request: copy bad sectors to sparse file


From: Ole Tange
Subject: [Bug-ddrescue] Feature request: copy bad sectors to sparse file
Date: Tue, 1 Aug 2017 08:57:12 +0200

I have said it before, but it cannot be repeated too often: Thanks you
for ddrescue.

This summer I had to rescue files from a broken disk. I did not have a
same or bigger sized disk with me.

It would have been really handy if I could have copied the bad sectors
onto a sparse file, then overlayed the device with the sparse file,
mounted it, and copied the files off the disk:

  mknod -m 660 /dev/loop1 b 7 1
  size=$(blockdev --getsize /dev/baddevice);
  truncate -s$size overlayfile
  ddrescue --onlybadblocks /dev/baddevice overlayfile mylog
  loop=$(losetup -f --show -- overlayfile);
  echo 0 $size snapshot /dev/baddevice $loop P 8 | dmsetup create baddevice
  mount /dev/mapper/baddevice

I would imagine all you have to do is ignore the blocks that succeeds
reading in the first try, and do as normal for all the rest.


/Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]