Looking inside device files

Matt McCutchen hashproduct+rsync at gmail.com
Tue Aug 21 09:55:44 GMT 2007


On 8/20/07, Andre Majorel <aym-cnysr at teaser.fr> wrote:
> Is there a way to make rsync look inside device files ? The goal
> is to copy the contents of a block device to a regular file
> incrementally.
>
> Short of that, even just getting it to dump the block checksums of
> the content a block device would help (if I know which blocks are
> out of sync, I can fix them with dd).

Are the block device and the target regular file on the same machine?
Your remark about dd suggests that they are.  If so, why do you want
an incremental copy?  It does at least as much disk I/O as an ordinary
copy (since it reads the entire basis file), and the reduction in data
passed from the sender process to the receiver process is irrelevant.

Anyway, the attached patch for the current CVS rsync adds an option
--copy-devices that makes rsync copy the contents of source device
files as if they were regular files.  I tested the option on my
computer to copy a block device to a regular file locally, and it
seemed to work.  Wayne, you might like to include this patch in the
patches/ dir of the source distribution.

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: copy-devices.diff
Type: text/x-patch
Size: 3716 bytes
Desc: not available
Url : http://lists.samba.org/archive/rsync/attachments/20070821/8ec029b8/copy-devices.bin


More information about the rsync mailing list