5

Is there a command to show which btrfs subvolumes are mounted on each mountpoint?

Alternatively, is there somewhere (e.g. in the /proc or /sys trees) where the information can be read?

The output from the df command simply shows the filesystem's root device and /etc/mtab (aka /proc/mounts) doesn't contain the subvol=... option.

  • excellent! mount doesn't contain the subvol=... option, either. – user1902689 Jun 25 '15 at 4:31
  • @user1902689: I don't understand your comment. If I mount a btrfs subvolume using mount -tbtrfs -osubvol=home,compress=zlib,autodefrag,recovery /dev/sdc /home then /etc/mtab contains a line /dev/sdc /home btrfs rw,relatime,compress=zlib,space_cache,autodefrag,recovery 0 0. The subvol=... option isn't included. What are you referring to? – StarNamer Jun 28 '15 at 15:36
9

findmnt -nt btrfs, the source subvolume is in [...], the mountpoint is the first column. Alternatively, you could look into the file /proc/self/mountinfo yourself.

  • thanks! - didn't know about findmnt. (I use mount | grep btrfs per answer below.) – go2null Sep 3 '17 at 22:38
  • Thanks. For those like me that land here via google looking for a way to just list the mountpoints using btrfs, just add the --output TARGET parameter: findmnt -nt btrfs --output TARGET – Boris Feb 17 at 16:34
2

On older systems that don't have the nicely-formatted findmnt command, just run mount with no arguments. It will spit out a list of devices, mountpoints, types and options. Pipe it to grep for btrfs if you want to filter it down for easy reading.

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.