-x option inoperative with "bind" mounts

Louis-David Mitterrand vindex at apartia.org
Wed May 18 17:33:21 GMT 2005


On Wed, May 18, 2005 at 07:27:30PM +0200, Paul Slootman wrote:
> 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?)

Thanks for the clear explanation. I'll use excludes.

-- 
Every day is a gift, that's why the present is so named


More information about the rsync mailing list