Add compute-storage-gpu-01 mapping and fix output formatting
- Add PCI path mappings for compute-storage-gpu-01 (5 SATA + 1 NVMe) - Fix NVMe drives output formatting (use lsblk for size, parse columns properly) - Fix Ceph RBD devices output formatting (proper column alignment) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -118,6 +118,19 @@ declare -A SERVER_MAPPINGS=(
|
|||||||
pci-0000:0e:00.0-nvme-1 m2-1
|
pci-0000:0e:00.0-nvme-1 m2-1
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# compute-storage-gpu-01
|
||||||
|
# Motherboard: ASUS PRIME B550-PLUS with AMD SATA controller at 02:00.1
|
||||||
|
# 5 SATA ports + 1 M.2 NVMe slot
|
||||||
|
# sdf is USB/card reader - not mapped
|
||||||
|
["compute-storage-gpu-01"]="
|
||||||
|
pci-0000:02:00.1-ata-1 1
|
||||||
|
pci-0000:02:00.1-ata-2 2
|
||||||
|
pci-0000:02:00.1-ata-3 3
|
||||||
|
pci-0000:02:00.1-ata-4 4
|
||||||
|
pci-0000:02:00.1-ata-5 5
|
||||||
|
pci-0000:0c:00.0-nvme-1 m2-1
|
||||||
|
"
|
||||||
|
|
||||||
# storage-01
|
# storage-01
|
||||||
# Different motherboard, no HBA currently
|
# Different motherboard, no HBA currently
|
||||||
# TODO: Map actual PCI paths after running diagnose-drives.sh
|
# TODO: Map actual PCI paths after running diagnose-drives.sh
|
||||||
@@ -278,12 +291,20 @@ done
|
|||||||
|
|
||||||
# NVMe drives
|
# NVMe drives
|
||||||
if command -v nvme >/dev/null 2>&1; then
|
if command -v nvme >/dev/null 2>&1; then
|
||||||
nvme_drives=$(sudo nvme list 2>/dev/null | grep "^/dev")
|
nvme_output=$(sudo nvme list 2>/dev/null)
|
||||||
if [ -n "$nvme_drives" ]; then
|
if echo "$nvme_output" | grep -q "^/dev"; then
|
||||||
echo -e "\n=== NVMe Drives ==="
|
echo -e "\n=== NVMe Drives ==="
|
||||||
printf "%-15s %-10s %-10s %-40s %-20s\n" "DEVICE" "SIZE" "TYPE" "MODEL" "SERIAL"
|
printf "%-15s %-10s %-10s %-40s %-25s\n" "DEVICE" "SIZE" "TYPE" "MODEL" "SERIAL"
|
||||||
echo "----------------------------------------------------------------------------------------------------------------------------"
|
echo "------------------------------------------------------------------------------------------------------"
|
||||||
echo "$nvme_drives" | awk '{printf "%-15s %-10s %-10s %-40s %-20s\n", $1, $6, "NVMe", $3, $2}'
|
# Parse nvme list output - format varies by version, use column positions
|
||||||
|
echo "$nvme_output" | grep "^/dev" | while read -r line; do
|
||||||
|
device=$(echo "$line" | awk '{print $1}')
|
||||||
|
serial=$(echo "$line" | awk '{print $2}')
|
||||||
|
model=$(echo "$line" | awk '{print $3}')
|
||||||
|
# Get size from lsblk for consistency
|
||||||
|
size=$(lsblk -d -n -o SIZE "$device" 2>/dev/null | xargs)
|
||||||
|
printf "%-15s %-10s %-10s %-40s %-25s\n" "$device" "$size" "NVMe" "$model" "$serial"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -292,12 +313,17 @@ fi
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Ceph RBD Devices
|
# Ceph RBD Devices
|
||||||
rbd_output=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT 2>/dev/null | grep "rbd" | sort -V)
|
rbd_devices=$(lsblk -d -n -o NAME,SIZE,TYPE 2>/dev/null | grep "rbd" | sort -V)
|
||||||
if [ -n "$rbd_output" ]; then
|
if [ -n "$rbd_devices" ]; then
|
||||||
echo -e "\n=== Ceph RBD Devices ==="
|
echo -e "\n=== Ceph RBD Devices ==="
|
||||||
printf "%-15s %-10s %-10s %-20s\n" "DEVICE" "SIZE" "TYPE" "MOUNTPOINT"
|
printf "%-15s %-10s %-10s %-30s\n" "DEVICE" "SIZE" "TYPE" "MOUNTPOINT"
|
||||||
echo "------------------------------------------------------------"
|
echo "------------------------------------------------------------"
|
||||||
echo "$rbd_output"
|
echo "$rbd_devices" | while read -r name size type; do
|
||||||
|
# Get mountpoint if any
|
||||||
|
mountpoint=$(lsblk -n -o MOUNTPOINT "/dev/$name" 2>/dev/null | head -1)
|
||||||
|
[[ -z "$mountpoint" ]] && mountpoint="-"
|
||||||
|
printf "%-15s %-10s %-10s %-30s\n" "/dev/$name" "$size" "$type" "$mountpoint"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Show mapping diagnostic info if DEBUG is set
|
# Show mapping diagnostic info if DEBUG is set
|
||||||
|
|||||||
Reference in New Issue
Block a user