From 60600d6b63bf526648f9f1676bd765c506c3cbcd Mon Sep 17 00:00:00 2001 From: Tim Connors Date: Thu, 4 Nov 2021 23:37:49 +1100 Subject: [PATCH] zfs list -t filesystem,volume to suppress snapshots zfs list might list a bunch of transient snapshots if `zpool listsnapshots=on` and something like zfs-auto-snapshot is used. It's also not useful to graph them since they're unchanging in time, and the parent volume is graphed anyway. Limit zfs list to "filesystem,volume" instead of "all" including snapshots --- plugins/zfs/zfs_list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/zfs/zfs_list b/plugins/zfs/zfs_list index 7307f9d5..1128b1ba 100755 --- a/plugins/zfs/zfs_list +++ b/plugins/zfs/zfs_list @@ -31,7 +31,7 @@ if [ "$1" = "suggest" ]; then fi if [ "$1" = "config" ]; then - for i in `zfs list -Hp | awk '{print $1}'`; do + for i in `zfs list -Hp -t filesystem,volume | awk '{print $1}'`; do values=( $(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota $i | awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}') ) fsname=$(clean_fieldname $(echo "$i" | sed 's/\//__/g')) @@ -75,7 +75,7 @@ EOF exit 0 fi -for i in `zfs list -Hp | awk '{print $1}'`; do +for i in `zfs list -Hp -t filesystem,volume | awk '{print $1}'`; do values=( $(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota $i | awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}') ) fsname=$(clean_fieldname $(echo "$i" | sed 's/\//__/g'))