From b79c69be99a45ad4b84d6054fb2cf120d4ada74a Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 5 Feb 2026 20:23:10 -0500 Subject: [PATCH] Fix OSD header regex to match double-digit OSD numbers The ceph-volume lvm list output varies the number of trailing equals signs based on OSD number length: - Single digit: "====== osd.5 =======" (7 equals) - Double digit: "====== osd.19 ======" (6 equals) Changed regex to require exactly 6 trailing equals, which matches both formats. Fixes: https://code.lotusguild.org/LotusGuild/driveAtlas/issues/17 Co-Authored-By: Claude Opus 4.5 --- driveAtlas.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driveAtlas.sh b/driveAtlas.sh index ed04310..41a378d 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -667,8 +667,9 @@ build_ceph_cache() { 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 + # Match OSD header: "====== osd.5 =======" or "====== osd.19 ======" + # Number of trailing equals varies based on OSD number length + if [[ "$line" =~ ======[[:space:]]+osd\.([0-9]+)[[:space:]]+====== ]]; then current_osd="osd.${BASH_REMATCH[1]}" # Match "devices" line which has the actual physical device: " devices /dev/sda" # This is more reliable than "block device" which may show LVM paths