11

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.

2
  • excellent! mount doesn't contain the subvol=... option, either. Jun 25, 2015 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, 2015 at 15:36

2 Answers 2

18

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.

2
  • 1
    thanks! - didn't know about findmnt. (I use mount | grep btrfs per answer below.)
    – go2null
    Sep 3, 2017 at 22:38
  • 1
    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, 2019 at 16:34
5

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .