Skip to content

Instantly share code, notes, and snippets.

@xkr47
Created December 5, 2023 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xkr47/529b112beee5704419bcecff120c9504 to your computer and use it in GitHub Desktop.
Save xkr47/529b112beee5704419bcecff120c9504 to your computer and use it in GitHub Desktop.
Dump all kinds of info for btrfs mounts
#!/bin/bash
[ "$#" = 1 ]
r () {
echo -ne "\033[1m------ "
echo -n "$@"
echo -e "\033[m"
"$@"
}
r btrfs de st "$1"
r btrfs de us "$1"
r btrfs fi sh "$1"
r btrfs fi us "$1"
r btrfs fi df "$1"
devs=$(btrfs fi sh "$1" | perl -ne 'print $1 if(m!path (/dev/[^ ]+)!)')
for dev in $devs ; do
r btrfs inspect-internal dump-super "$dev"
done
r btrfs sc stat -d "$1"
r btrfs ba stat "$1"
r btrfs rep stat -1 "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment