Don't follow bind mounts?

Kevin Korb kmk at
Thu May 16 13:43:35 MDT 2013

Hash: SHA1

That is a nice simple solution that I will have to remember for later.

In my case I was doing lvm2 snapshots anyways so it didn't matter
since the snapshot is a separate mount point to be rsync'd.

On 05/16/13 15:33, Shachar Shemesh wrote:
> On 16/05/13 03:52, Carl Brewer wrote:
>> Hello, The manual says that rsync treats bind mounts on UNIX
>> (Linux) to the same filesystem as being on the same filesystem.
>> I have a server with a pile of bind mounts to the same filesystem
>> for some access control/ease of use for FTP users modifying
>> websites. This makes my backups using rsync messy!
>> Is there any way to stop rsync from following bind mounts to the
>> same filesystem?  Short of unmounting them all at backup time
>> and remounting afterwards or explicitly excluding each one?
> Rsync uses the device id to know whether it has crossed a mount 
> boundary. Since bind mounts have the same device ID, rsync does not
> know it has reached one. Most other tools (tar) have the same
> problem.
> My personal solution is to bind-mount the root of the file system
> to a neutral location, and rsync from there. So if I have
> /dev/sda17 mounted on /src/messy, with lots and lots of bind mounts
> (and other filesystems) inside it, I do "mount --bind /srv/messy
> /tmp/backup", and then rsync from /tmp/backup.
> This also makes sure that I back up all directories hidden by
> other mounts done later.
> Shachar

- -- 
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at  (work)
	Orlando, Florida		kmk at (personal)
	Web page:
	PGP public key available on web site.
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


More information about the rsync mailing list