Re: rsync -ax and subvolumes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

Am Do., 10. Okt. 2019 um 19:32 Uhr schrieb Ulli Horlacher
<framstag@xxxxxxxxxxxxxxxxxxxx>:
>
> I run into the problem that "rsync -ax" sees btrfs subvolumes as "other
> filesystems" and ignores them.

I worked around it by mounting the btrfs-pool at a special directory:

mount -o subvolid=0 /dev/disk/by-label/rootfs /mnt/btrfs-pool

Then run rsync from /mnt/btrfs-pool without the "-x" flag. It won't
see mount points with foreign filesystems anyway below that mount
point.

> How could I tell rsync to include btrfs subvolumes, but exclude
> other mounted filesystems?

You can't, btrfs subvolumes are distinctive filesystems when viewed
from the API: they have their own set of inodes and thus their own
dev-id (and when that changes between two directories, you're crossing
a filesystem boundary).

> Do I have to write a rsync wrapper script and find all subvolumes to have
> them included? Nasty task...

The trick above should do, as long as you don't mind seeing another
view of your btrfs-pool opposed to your root mount view. It has the
benefit of seeing all your stuff. And it has the benefit of no longer
seeing API mounts there (like proc, sys, dev) and you can should rsync
without any more excludes needed.

Actually, you could also just bind-mount into /mnt/btrfs, bind-mounts
won't inherit other mounts but will still see pure subvolumes.

HTH
Kai



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux