Skip to content
Commit 5762bd30 authored by David Zeuthen's avatar David Zeuthen
Browse files

Make "Create Disk Image" feature tolerate read errors

The "Create Disk Image" feature is often used to copy data from a
failing drive (or scratched medium) so it is far from uncommon to
encounter read errors. In fact, you could argue that you mostly only
use this feature when dealing with a failing disk (or medium).

Therefore, if a read fails (or a partial read is returned), simply
skip the bytes we didn't get and write zeroes in the disk image
instead. Also convey that to the user.

Right now the granularity is 1 MiB. In the future we could something
like what e.g. GNU ddrescue is doing, see

 http://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html#Algorithm
 http://ubuntu-rescue-remix.org/node/51

That is, we could record a list of failed reads and then go backwards
through that list to try to recover even more data. But for now, just
having the ability to skip data is really good.

The user experience has also changed - when copying is complete
instead of dismissing the dialog, we:

 - show a "Close" button instead of a "Cancel" button

 - play the "complete" sound

 - slightly change the progress string to convey that the operation
   is complete

 - show a "Show in Folder" button that will open a Nautilus window and
   select the created disk image file

Implementation-wise we also do the copying a dedicated thread - much
easier to read than the async mess we had before.

http://people.freedesktop.org/~david/gnome-disks-create-disk-image-ft-1.png
http://people.freedesktop.org/~david/gnome-disks-create-disk-image-ft-2.png
http://people.freedesktop.org/~david/gnome-disks-create-disk-image-ft-3.png



Signed-off-by: default avatarDavid Zeuthen <zeuthen@gmail.com>
parent 27a5524d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment