Created
August 8, 2024 15:30
-
-
Save cwilkers/9bd927bf8bea3c9f9856a079b070081b to your computer and use it in GitHub Desktop.
Clear old data on PVs for ODF after reinstalling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for pod in $(oc -n openshift-storage get pod -l app=rook-ceph-osd-prepare -o name) | |
do | |
DISK=$(oc -n openshift-storage get $pod -oyaml | grep -A1 ROOK_DATA_DEVICES | awk -F'"' '/value/ {print $4}') | |
oc -n openshift-storage debug $pod -- bash -c "sgdisk --zap-all $DISK; dd if=/dev/zero of=$DISK bs=1M count=100 oflag=direct,dsync" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment