• 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.

The way you've set it up there isn't any functional difference. It's just the same as if you never created the root subvolume because you made it the default. It's not the way most people who are trying to take full advantage of the subvolume abstraction would do it, but it's perfectly acceptable. I personally prefer extensive separation because of the incredibly easy and powerful backups btrfs is known for, and without changing the default subvolume.

Nonetheless, all subvolumes are folders for most intents and purposes. The difference is you can mount them with mount just like a filesystem without the need for bind if you don't want to. As I understand it, every "normal" utility (such as the cp you mentioned) will treat it like a regular folder regardless of how you mount it, btrfs-specific tools excepted obviously. There might be a few exceptions, but I don't recall any in my fairly thorough testing. I invite anybody to correct me on that.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.