The Btrfs filesystem uses the terms subvolume, root-volume, snapshot, top-level, default subvolume somewhat confusingly to me.

An example is the btrfs wiki page about subvolumes which states

A freshly created filesystem is also a subvolume, called top-level, internally has an id 5. This subvolume cannot be removed or replaced by another subvolume.

However, as using tools like btrfs-progs commands such as

  • btrfs subvolume list
  • btrfs subvolume show

exhibit, the term subvolume does not apply really to the rootvolume (see this other question). Additionally the term top-level (as can be seen in the output of the above commands, is not really limited to the subvolume/root volume with subvolumeid 5. Finally it seems you cannot ever btrfs send the root volume, just subvolumes (again contrasting to the definitions above).

Any help?


The simplest way to explain this is to make an analogy to ZFS. Subvolumes in BTRFS are functionally equivalent to zvols from ZFS, except they are inherently rooted somewhere in the filesystem itself.

More generically, a subvolume consists of a set of filesystem internal data structures that are mostly independent from the rest of the tree. By this definition, and the internals of the code itself, the top-level or root subvolume (subvolid 5) is technically a subvolume, but it treated specially by commands that display information about subvolumes because you can't do many of the things with it that you can with regular subvolumes (for example, you can't snapshot the root subvolume, and you can't delete it either). From a user perspective, the only place that it mattrs that the root subvolume is a subvolume is when mounting with -o subvolid=5 to bypass a default subvolume setting.

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.