rsyncing devices

Dave Dykstra dwd at bell-labs.com
Wed Nov 28 06:19:06 EST 2001


I can reproduce it, and I think you've stumbled on a significant bug.  The
problem is that rsync always assumes stat variable "st_rdev", which
contains both the major and minor number, is always 4 bytes and is always
the same format on both sides.  On the rsync I tried on Linux, it is 8
bytes, whereas it was 4 bytes on Solaris.  I assume it depends on whether
or not 64 bit mode gets enabled on the operating system version you're on.
Furthermore, a simple test on Linux of
    mknod test c 11 104
    rsync -a test test2
resulted in an even worse result of both major and minor number being set
to zero.

This will take a protocol change to fix.  I think probably rsync should
split out the major and minor numbers as two separate 4 byte quantities.  I
wonder if there are other 64 bit stat values that are being misinterpreted.

- Dave Dykstra


On Tue, Nov 27, 2001 at 09:35:40AM -0800, Cheryl L. Southard wrote:
> Hi All,
> 
> I'm running rsync version 2.4.6 protocol version 24 on several Solaris 2.8
> computers, and seversl RedHat Linux 7.2 computers.  I have several
> character devices that I am rsyncing from my Solaris computer.  Rsync
> works from one solaris to another solaris computer.  But rsyncing these
> devices does not work from a solaris computer to the Linux computer.
> The devices are being copied over for archival reasons, and really aren't
> going to be used in any "device" manner, but it would be nice if they
> were correct.
> 
> Here's an example of what the device looks like on the solaris computer:
> crw-------   1 root     sys       15,  0 Aug 31  2000 wc at 0:wscons
> crw-------   1 root     sys       11,104 Aug 31  2000 clone at 0:qe
> 
> And this is the incorrect rsynced version on the Linux computer:
> crw-------    1 root     sys        0,   0 Aug 31  2000 wc at 0:wscons
> crw-------    1 root     sys        0, 104 Aug 31  2000 clone at 0:qe
> 
> 
> Rsync gets most everything correct except the device's MAJOR number.
> But since it runs daily in a cronjob, rsync notices that the device
> isn't correct the next day and proceeds to re-copy this device over again.
> 
> Here's my rsync command:
> rsync -avx --delete --exclude=lost+found --exclude=TT_DB \
> 	user at solarisserver::solaris-usr-local/ /solaris/
> 
> I've also tried adding the -D flag (which is included in the -a flag).
> 
> Anyone with any suggestions?
> 
> Thanks,
> 
> Cheryl
> -- 
> Cheryl Southard
> cld at astro.caltech.edu




More information about the rsync mailing list