Rsyncing of block devices to a remote file

David Heremans DHeremans at
Thu Jan 23 08:18:00 EST 2003


I'm looking for some assistance in modifying the rsync code

Situation: I used to back-up some of my (unmounted NTFS) disk partitions
remotely using the following shells construct:
dd if=/dev/hda1 | gzip | ssh me at backupmachine 'cat >

But now I want to use rsync for this, since transfering 10 gig takes a litle
to long if a file of a few kB has changed :-). I looked trough the archive
and found an old mail talking about the same problem, and a response
explaining the problem of writting to a block device (since rsync writes a
copy file and then moves it over the original). But the same mail also said
that reading from it should be trivial, so I set out trying to implement

So I created a '--read-block-file' option in options.c and avoided the
'skipping non regular file' message in generator.c
By altering all this the receiver is ready to get the data, but in the flist
structure it still says that '/dev/hda1' is still a devicefile 
and that the size is 0, and so the sender does send over zero bytes

Now here is the problem : How do I get the size of partition in this
datastructure ? Or more generique, how would I handle this for /dev/fd0,
since you can insert 1.44MB disks or 720kB disks ?

Anybody else tried to read blockdevices over rsync already ?

After all, sending the data of a block device doesn't seem to be as trivial
as the archived mail sugested :-)


-------------- next part --------------
HTML attachment scrubbed and removed

More information about the rsync mailing list