Skip to content

Commit

Permalink
Detect iSCSI in the zpool cmd vdev media script
Browse files Browse the repository at this point in the history
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes openzfs#12206
  • Loading branch information
Don Brady authored and tonyhutter committed Sep 14, 2021
1 parent e16e05c commit 6ca1f30
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/zpool/zpool.d/media
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

if [ "$1" = "-h" ] ; then
echo "Show whether a vdev is a file, hdd, or ssd."
echo "Show whether a vdev is a file, hdd, ssd, or iscsi."
exit
fi

Expand All @@ -18,6 +18,13 @@ if [ -b "$VDEV_UPATH" ]; then
if [ "$val" = "1" ]; then
MEDIA="hdd"
fi

vpd_pg83="/sys/block/$device/device/vpd_pg83"
if [ -f "$vpd_pg83" ]; then
if grep -q --binary "iqn." "$vpd_pg83"; then
MEDIA="iscsi"
fi
fi
else
if [ -f "$VDEV_UPATH" ]; then
MEDIA="file"
Expand Down

0 comments on commit 6ca1f30

Please sign in to comment.