With the following subvolumes on a btrfs filesystem on /dev/sda3:


and the following mount:

/dev/sda3 on /

Is the /home folder on the root subvolume, or on the root/home subvolume?


The default subvolume

When you create a brand new BTRFS filesystem, the system not only creates the initial the root subvolume (numbered 0) but also tags it as being the default subvolume. When you ask the operating system to mount a subvolume contained in a BTRFS volume without specifying a subvolume number, it determines which of the existing subvolumes has been tagged as "default subvolume" and mounts it. If none of the exiting subvolumes has the tag "default subvolume" (e.g. because the default subvolume has been deleted), the mount command gives up with a rather cryptic message:

# mount /dev/loop0 /mnt
mount: No such file or directory

It is also possible to change at any time which subvolume contained in a BTRFS volume is considered the default volume. This is accomplished with btrfs subvolume set-default. The following tags the subvolume 261 as being the default:

# btrfs subvolume set-default 261 /mnt

After that operation, doing the following is exactly the same:

# mount /dev/loop0 /mnt
# mount -o subvolid=261 /dev/loop0 /mnt

From http://www.funtoo.org/BTRFS_Fun

  • I had mounted the default subvolume without setting the appropriate subvolid in the mount flags. Hence I ended up with a volume mounted that had a /root folder with a /root/home etc. It seems the answer to my question is actually Yes. Btrfs does indeed mount nested volumes. – Joshka Sep 29 '13 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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