2020-09-20: Finding btrfs subvolumes[edit | edit source]
Sometimes you want to make a list of all subvolumes under some /path in your filesystem.
One way to do it is to use
btrfs subvolume list. However, this does not list directories with mounted subvolumes. It is also difficult to read it's output.
find might be an easier way. Lets say we want to look in
# find /var/ -type d -inum 256 /var/cache /var/db /var/db/repos /var/lib/boinc /var/lib/mysql /var/lib/plexmediaserver /var/lib/redis /var/lib/unifi /var/log /var/spool/jabber /var/spool/mail /var/tmp /var/www
-type d: Means look for directories. -inum 256: Means we should look for directories with inode number 256. Btrfs subvolumes all have this inode number.
- Btrfs Trees design