Getting an understanding of btrfs details and leveraging them for all the things I used to do with lvm/xfs proceeds.
To find the information I am looking for I have come up with these based on clues I gleaned from your replies and further documentation searches. It is not as straight forward as I expected which may be due to me going about it the wrong way.
Any clues on better solutions?
What other questions would be useful to know the answers to?
##Discover btrfs filesystems, mounted or not, on a system:
lsblk -no UUID,PATH,FSTYPE,MOUNTPOINTS | grep btrfs
##Devices in a btrfs filesystem:
ls -1d /sys/fs/btrfs/<UUID>/devices/*
##Checksum algorithm:
#Would be great if this worked against a UUID
btrfs inspect-internal dump-super <DEVICE> | grep csum
grep . /sys/fs/btrfs/<UUID>/checksum
##Compression algorithm:
#for kickstarting the compress=no is needed for both fsoptions and mkfsoptions unless anaconda modified
# part btrfs.111 --fstype="btrfs" --grow --size=1 --fsoptions="noatime,compress=no" --ondisk=/dev/disk/by-id/virtio-os
# btrfs none --label=os --mkfsoptions="--data=single --metadata=single --mixed --compress=no" btrfs.111
# btrfs / --subvol --name=r LABEL=os
# After booting into kickstarted system the compress=* that anaconda adds can be removed from /etc/fstab
#As far as I can tell btrfs property cannot change filesystem compression, only per-{file,directory} compression on filesystems with compression enabled
#if compression enabled, algorithm will be indicated in feature name
ls -1 /sys/fs/btrfs/<UUID>/features/* | grep compress
##data/metadata mode:
#Would be great if this worked against a UUID
btrfs device usage <path to mount point of a mounted root or any subvolume>
#if exists, mixed otherwise isolated
ls -1 /sys/fs/btrfs/<UUID>/features/* | grep mixed_groups
##Profiles
#DUP profiles are not interesting to me in use cases this is applied to (ie: quality nvme and rigorous backups)
#data=single is default but keeping it in ks.cfg improves clarity
#Would be great if this worked against a UUID
btrfs device usage <path to mount point of a mounted root or any subvolume>
#The information is here but not in a great form
find /sys/fs/btrfs/<UUID>/allocation
The situation is MUCH better for xfs, ext4 and even vfat
xfs_info <mntpt|device>
xfs_db -r -c info <device>
tune2fs -l <device>
minfo -i <device>