summaryrefslogtreecommitdiff
path: root/disklabel.sh
diff options
context:
space:
mode:
authordoc <doc@filenotfound.org>2025-06-28 16:10:39 +0000
committerdoc <doc@filenotfound.org>2025-06-28 16:10:39 +0000
commite8df369d2f8875459edc7ac6518f73a8df3bff86 (patch)
tree3f023fd5d867d42fdd0af649bf78ca17926c692a /disklabel.sh
initial commitHEADmaster
Diffstat (limited to 'disklabel.sh')
-rwxr-xr-xdisklabel.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/disklabel.sh b/disklabel.sh
new file mode 100755
index 0000000..0159dbe
--- /dev/null
+++ b/disklabel.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+echo "🟩 Disk-to-Serial Mapping with SMART Info (Linux ZFS VM)"
+echo "========================================================"
+
+for disk in /dev/sd? /dev/nvme?n1; do
+ if [[ -b "$disk" ]]; then
+ echo " 🔹 Device: $disk"
+
+ # Udev info (model and serial)
+ udevadm info --query=all --name="$disk" | grep -E 'ID_MODEL=|ID_SERIAL=' | sed 's/^/ /'
+
+ # SMART info
+ if command -v smartctl &> /dev/null; then
+ echo " SMART Summary:"
+ smartctl -i "$disk" | grep -E 'Model|Serial|Firmware' | sed 's/^/ /'
+ smartctl -H "$disk" | grep 'SMART overall-health' | sed 's/^/ /'
+
+ # Uncomment to show full SMART report (can get lengthy)
+ # smartctl -a "$disk" | sed 's/^/ /'
+ else
+ echo " smartctl not found. Install smartmontools."
+ fi
+
+ echo
+ fi
+done
+
+echo "🟩 Current ZFS Pool Status (zpool status)"
+echo "========================================="
+zpool status -v