--one-file-system problem

Paul Slootman paul at debian.org
Wed Mar 2 08:47:45 GMT 2005


On Tue 01 Mar 2005, Chuck Wolber wrote:
> 
> rsync commandline:
> 
> /usr/bin/rsync -e /usr/bin/ssh --archive --compress --sparse  
> --verbose --stats --delete --numeric-ids --partial --relative  
> --one-file-system  target.host:/ /destination/path/
> 
> target rsync version: 2.6.3
> destination rsync version: 2.6.2
> 
> 
> The server we're trying to synchronize contains directories within "/" 
> that are mounted to other locations within "/". When the sync occurs, the 

Hmm, do you mean bind mounts? Those _are_ effectively the same
filesystem in your case.

> mounted directories get copied, despite the fact that we use the 
> --one-file-system argument. Is this a bug, or have I misunderstood the use 
> of the --one-file-system argument?

The check for one-file-system is generally done by comparing the device
number to the one on the starting point, not by checking for mount
points (I haven't checked how rsync does it exactly).  Such a check
won't discover bind mounts...

> I can wrap my mind around the fact that the mounted directory is actually 
> a part of the filesystem that it is mounted to, and thus can't be divorced 
> from the concept of one file system. If that's truly the case, is it worth 
> my time to come up with a --really-one-file-system patch?

I think there wouldn't be much demand for it, it's a pretty specific
case. I'm guessing it would also impact performance, unless e.g. you use
/proc/mounts (on Linux) to generate an internal --exclude list...


Paul Slootman


More information about the rsync mailing list