Directly mount btrfs subvolume or bind mount if already visible

bind-mountbtrfsmount

  • If /dev/sda1 is a btrfs filesystem with subvol's root and persistent

  • And I've set the default subvol to root

  • Also, I've mounted /dev/sda1 (again root is default) to /

  • And I've mounted /dev/sda1 subvolid=0 to /btrfs, so I can access all the other subvols (yes / now exists as a duplicate /btrfs/root which I find desirable so everything in here is treated as being on the same filesystem)

What differences are there between:

  1. mount /dev/sda1 -o subvol=persistent /persistent

  2. mount --bind /btrfs/persistent /persistent

I'm thinking along the lines of not immediately seen differences, such as being treated differently on whether going into persistent crosses to a different filesystem in a cp -x (cp --one-file-system). Both options should be treated as going into a different filesystem, so there's no difference here – I just discussed this as the kind of difference that might exist, one that isn't readily apparent.

Best Answer

If mount propagation is enabled (see man mount_namespaces) future submounts will be copied between the mounts if created using a bind mount.

Related Question