Fix local keyword used outside function, document storage-01 HBA layout

- Remove `local` from max_parallel_jobs/job_count (not inside a function)
- Document storage-01 physical layout: mobo SATA ports, HBA Mini-SAS HD
  ports C0-C3, U.2 NVMe serial numbers

Ref #25

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-06 18:15:45 -05:00
parent 71f83e82c5
commit 2177ae9092

View File

@@ -520,8 +520,18 @@ declare -A SERVER_MAPPINGS=(
"
# storage-01
# Motherboard: ASRock A320M-HDV R4.0 with AMD SATA controller at 02:00.1
# 4 SATA ports used (ata-1, ata-2, ata-5, ata-6) - ata-3/4 empty
# Motherboard: ASRock A320M-HDV R4.0
# AMD SATA controller at 02:00.1 (bays 1-4)
# Mobo SATA physical layout:
# top-left=bay 1, bottom-left=bay 2, top-right=bay 3, bottom-right=bay 4
# HBA: LSI SAS3416 at 01:00.0 (4x Mini-SAS HD ports, top=C0 to bottom=C3)
# C0 (top): 4x SATA breakout → bays 5-8
# C1: 4x SATA breakout → bays 9-10 (2 of 4 ports used)
# C2: U.2 NVMe (serial ends in 0d66) → u2-1
# C3: U.2 NVMe (serial ends in 0d4f) → u2-2
# NOTE: HBA PHY-to-bay mapping needs verification via ls -la /dev/disk/by-path/
# NOTE: U.2 drives require HBA firmware update to appear
# Also present: 09:00.0 AMD FCH SATA Controller [AHCI mode]
["storage-01"]="
pci-0000:02:00.1-ata-1 1
pci-0000:02:00.1-ata-2 2
@@ -994,8 +1004,8 @@ if [[ "$SKIP_SMART" != true ]]; then
SMART_CACHE_DIR="$(mktemp -d)"
log_info "Collecting SMART data in parallel..."
local max_parallel_jobs=10
local job_count=0
max_parallel_jobs=10
job_count=0
for bay in $all_bays; do
device="${DRIVE_MAP[$bay]}"
if [[ -n "$device" && "$device" != "EMPTY" && -b "/dev/$device" ]]; then