Skip to content

Commit 2a4a4fd

Browse files
adrianrioboclaude
andcommitted
fix(ibmcloud): fix mapper device detection on IBM Power
lsblk -d excludes holder devices, which includes all /dev/mapper/* devices on multipath systems. Switch to lsblk -r (raw) and detect the data volume by finding the mpath device that has no partition children, distinguishing it from the boot disk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 095ff60 commit 2a4a4fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/provider/ibmcloud/action/ibm-power/cloud-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ write_files:
1111
fi
1212
DATA_DEV=""
1313
while true; do
14-
DATA_DEV=$(lsblk -dpno NAME,PTTYPE | awk '$2=="" && $1 ~ /\/dev\/mapper\// && $1 !~ /control/ {print $1}' | head -1)
14+
DATA_DEV=$(lsblk -rnpo NAME,TYPE | awk '$2=="mpath"{mpath[$1]=1} $2=="part"{p=$1; sub(/p[0-9]+$/,"",p); has_part[p]=1} END{for(d in mpath) if(!has_part[d]&&d!~/control/) print d}' | head -1)
1515
[ -n "$DATA_DEV" ] && break
1616
udevadm trigger --subsystem-match=block 2>/dev/null || true
1717
udevadm settle 2>/dev/null || true

0 commit comments

Comments
 (0)