-x option inoperative with "bind" mounts

Paul Slootman paul at debian.org
Wed May 18 17:27:30 GMT 2005


On Wed 18 May 2005, Louis-David Mitterrand wrote:
> 
> I have this mount defined in /etc/fstab:
> 
> /backup/current/usr/local/share/premier /var/www/g5/trunk/Naxos none bind,ro
> 
> When I backup /var with rsync using (among other) the -x option (one
> filesystem) then the whole contents of
> /backup/current/usr/local/share/premier are also backed up as they are
> mounted on /var/www/g5/trunk/Naxos.
> 
> Is this expected behavior? I thought -x would exclude any mount,
> including "bind" mounts.

No, -x means "stay on this filesystem". You *are* on the same
filesystem...

This is determined by looking at the device number as returned by stat()
(on linux you may have the stat command that displays that info). That
corresponds to the block device on which the filesystem resides, and
that doesn't change with a bind mount.

You'd need to add an explicit --exclude for the bind mount point.
(Does the concept of "bind mount" exist on systems other than linux?)


Paul Slootman


More information about the rsync mailing list