Created
July 21, 2020 14:59
-
-
Save rpsene/41ade69f9ff493b0f26c66963b3d8502 to your computer and use it in GitHub Desktop.
A simple way to get only the name and size of multipath devices.
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
multipath -ll | sed -n '/^mpath/,/^size/p' >> /tmp/mpath.log && x=1 && while IFS="" read -r p || [ -n "$p" ]; do STR1=$(printf '%s\n' "$p" | sed 's/\s.*$//'); STR2+=$STR1" "; y=$(($x % 2)); if [ $y -eq 0 ]; then printf '%s\n' "$STR2"; echo "---"; STR2=""; fi; x=$(( $x + 1 )); done < /tmp/mpath.log; rm -f /tmp/mpath.log; touch /tmp/mpath.log; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment