diff options
author | Don Brady <don.brady@delphix.com> | 2021-09-02 17:11:53 -0600 |
---|---|---|
committer | Tony Hutter <hutter2@llnl.gov> | 2021-09-14 15:40:52 -0700 |
commit | 6ca1f307082c3b650a2437a8c8f1f2a9b480c118 (patch) | |
tree | 63df4d4a7b217d213a4dedd7e4e7446215e70269 | |
parent | e16e05c9cf85d7de32af6139a521b802664d1413 (diff) |
Detect iSCSI in the zpool cmd vdev media script
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 #12206
-rwxr-xr-x | cmd/zpool/zpool.d/media | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/zpool/zpool.d/media b/cmd/zpool/zpool.d/media index 05bc15918..5683cdc3c 100755 --- a/cmd/zpool/zpool.d/media +++ b/cmd/zpool/zpool.d/media @@ -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 @@ -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" |