fix: btrfs/init.sh blkid probe (blkid -O is --offset, not "on device")

The deploy failed with:

    blkid: invalid offset argument '/dev/vda2': invalid argument
    error: /dev/vda2 is not a btrfs filesystem

`blkid -p -O "$DEV"` passed the device path to --offset, so the probe
always failed. Use a proper TYPE tag probe:

    blkid -p -s TYPE -o value "$DEV"   # -> "btrfs"

The guard now triggers only when the filesystem type is genuinely not
btrfs. The UUID lookups in deploy-disk.sh (-s UUID -o value) were already
correct.
This commit is contained in:
Blake Ridgway
2026-08-21 21:10:47 -05:00
parent 52d5460227
commit f879bcf219

View File

@@ -31,7 +31,8 @@ require_root "$0" "$@"
command -v btrfs >/dev/null || { echo "error: btrfs-progs not installed" >&2; exit 1; } 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 echo "error: $DEV is not a btrfs filesystem" >&2
exit 1 exit 1
fi fi