diff --git a/btrfs/init.sh b/btrfs/init.sh index e133874..a6d0fa7 100755 --- a/btrfs/init.sh +++ b/btrfs/init.sh @@ -31,7 +31,8 @@ require_root "$0" "$@" command -v btrfs >/dev/null || { echo "error: btrfs-progs not installed" >&2; exit 1; } -if ! blkid -p -O "$DEV" | grep -q btrfs 2>/dev/null; then +# Note: `blkid -O` is --offset, not "on device". Use a TYPE tag probe. +if [[ "$(blkid -p -s TYPE -o value "$DEV" 2>/dev/null)" != "btrfs" ]]; then echo "error: $DEV is not a btrfs filesystem" >&2 exit 1 fi