From 51cc739da52069f4e812e311a31dc1b00df42014 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 5 Feb 2026 20:04:49 -0500 Subject: [PATCH] Add debug logging for Ceph OSD detection Added log_info messages to show: - Count of OSDs found - Each device-to-OSD mapping as discovered Also fixed array subscript quoting in CEPH_DEVICE_TO_OSD. Run with --verbose to see Ceph detection diagnostics. Co-Authored-By: Claude Opus 4.5 --- driveAtlas.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/driveAtlas.sh b/driveAtlas.sh index 629b391..c9b93df 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -665,6 +665,7 @@ build_ceph_cache() { # Parse ceph-volume lvm list output # Format: blocks starting with "====== osd.X =======" followed by device info local current_osd="" + local osd_count=0 while IFS= read -r line; do # Match OSD header: "====== osd.5 =======" if [[ "$line" =~ ======[[:space:]]+osd\.([0-9]+)[[:space:]]+======= ]]; then @@ -672,9 +673,12 @@ build_ceph_cache() { # Match block device line: " block device /dev/sda" elif [[ -n "$current_osd" && "$line" =~ block[[:space:]]device[[:space:]]+/dev/([^[:space:]]+) ]]; then local dev_name="${BASH_REMATCH[1]}" - CEPH_DEVICE_TO_OSD[$dev_name]="$current_osd" + CEPH_DEVICE_TO_OSD["$dev_name"]="$current_osd" + ((osd_count++)) + log_info "Found $current_osd on $dev_name" fi done < <(ceph-volume lvm list 2>/dev/null) + log_info "Cached $osd_count Ceph OSDs" # Skip if ceph command is not available if ! command -v ceph &>/dev/null; then