From 15b7f9d83f12f7f9cb9d1dc0342df7afba5f2211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Fri, 8 Mar 2019 16:47:48 +0100 Subject: [PATCH] lsdasd: Add support for thin-provisioned volumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make lsdasd aware of thinly provisioned (Extent Space Efficient (ESE)) DASD volumes. The ESE information is added to the discipline output and the extended output additionally lists information about logical capacity, allocated space, and the extent size. Output before: Bus-ID Status Name Device Type BlkSz Size Blocks ============================================================================== 0.0.95e0 alias ECKD 0.0.7eb4 active dasda 94:0 ECKD 4096 7043MB 1803060 0.0.7eb7 active dasdb 94:4 ECKD 4096 7043MB 1803060 0.0.95d0 active dasdc 94:8 ECKD 4096 42259MB 10818360 0.0.95d1 n/f dasdd 94:12 ECKD 0.0.95d4 n/f dasde 94:16 ECKD 0.0.95d5 active dasdh 94:28 ECKD 4096 831097MB 212761080 Output after: Bus-ID Status Name Device Type BlkSz Size Blocks ================================================================================ 0.0.95e0 alias ECKD 0.0.7eb4 active dasda 94:0 ECKD 4096 7043MB 1803060 0.0.7eb7 active dasdb 94:4 ECKD 4096 7043MB 1803060 0.0.95d0 active dasdc 94:8 ECKD (ESE) 4096 42259MB 10818360 0.0.95d1 n/f dasdd 94:12 ECKD (ESE) 0.0.95d4 n/f dasde 94:16 ECKD (ESE) 0.0.95d5 active dasdh 94:28 ECKD (ESE) 4096 831097MB 212761080 Extended output before: 0.0.95d0/dasdc/94:8 status: active type: ECKD blksz: 4096 size: 42259MB blocks: 10818360 use_diag: 0 readonly: 0 eer_enabled: 0 erplog: 0 hpf: 1 uid: IBM.750000000ABT31.9500.d0 paths_installed: 38 39 3a 3b paths_in_use: 38 39 3a 3b paths_non_preferred: paths_invalid_cabling: paths_cuir_quiesced: paths_invalid_hpf_characteristics: paths_error_threshold_exceeded: Extended output after: 0.0.95d0/dasdc/94:8 status: active type: ECKD (ESE) blksz: 4096 size: 42259MB blocks: 10818360 extent_size: 1113 logical_capacity: 60102 space_allocated: 18921 use_diag: 0 readonly: 0 eer_enabled: 0 erplog: 0 hpf: 1 uid: IBM.750000000ABT31.9500.d0 paths_installed: 38 39 3a 3b paths_in_use: 38 39 3a 3b paths_non_preferred: paths_invalid_cabling: paths_cuir_quiesced: paths_invalid_hpf_characteristics: paths_error_threshold_exceeded: Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- zconf/lsdasd | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/zconf/lsdasd b/zconf/lsdasd index a0af6ea3..792efc0f 100755 --- a/zconf/lsdasd +++ b/zconf/lsdasd @@ -164,6 +164,7 @@ function gatherDeviceData() { read DEV_UID 2> /dev/null < $DEVPATH/uid || continue read READONLY 2> /dev/null < $DEVPATH/readonly || continue read DISCIPLINE 2> /dev/null < $DEVPATH/discipline || continue + read ESE 2> /dev/null < $DEVPATH/ese # Block device specific information is only available for # devices that are online and not a PAV alias @@ -244,7 +245,7 @@ function newoutput() #-------------------------------------------# if [[ "$ONLINE" == 0 ]]; then - printf "%s:%s:%-8s offline\n" \ + printf "%s:%s:%-8s offline\n" \ "$SORTKEYLEN" "$SORTKEY" \ "$BUSID" ; return @@ -252,7 +253,7 @@ function newoutput() if [[ "$ALIAS" == 1 ]]; then if [[ "$BASEONLY" == "false" ]]; then - printf "%s:%s:%-8s alias %28s\n" \ + printf "%s:%s:%-8s alias %26s\n" \ "$SORTKEYLEN" "$SORTKEY" \ "$BUSID" \ "$DISCIPLINE" @@ -286,7 +287,11 @@ function newoutput() ACTIVE="active" fi - printf "%s:%s:%-8s %-6s%-4s %-8s %-2s:%-2s %-4s %-4s %-8s %s\n" \ + if [[ "$ESE" == 1 ]]; then + DISCIPLINE="${DISCIPLINE} (ESE)" + fi + + printf "%s:%s:%-8s %-6s%-2s %-8s %-2s:%-2s %-11s %-4s %-8s %s\n" \ "$SORTKEYLEN" "$SORTKEY" \ "$BUSID" \ "$ACTIVE" \ @@ -378,6 +383,10 @@ function extended() read OPM NPPM CABLEPM CUIRPM HPFPM IFCCPM 2> /dev/null < $DEVPATH/path_masks read -a C 2> /dev/null < $DEVPATH/../chpids read PIM PAM POM 2> /dev/null < $DEVPATH/../pimpampom + read ESE 2> /dev/null < $DEVPATH/ese + read EXTSZ 2> /dev/null < $DEVPATH/extent_pool/extent_size + read CAPACITY 2> /dev/null < $DEVPATH/capacity/logical_capacity + read ALLOCATED 2> /dev/null < $DEVPATH/capacity/space_allocated # convert to hexadecimal values PIM=0x$PIM @@ -550,7 +559,11 @@ function extended() COLON=":" fi - printf "%s:%s:%s/%s/%s%s%s# status:\t\t\t\t%s# type: \t\t\t\t%s# blksz:\t\t\t\t%s# size: \t\t\t\t%s# blocks:\t\t\t\t%s# use_diag:\t\t\t\t%s# readonly:\t\t\t\t%s# eer_enabled:\t\t\t\t%s# erplog:\t\t\t\t%s# hpf:\t\t\t\t\t%s# uid: \t\t\t\t%s# paths_installed: \t\t\t%s %s %s %s %s %s %s %s# paths_in_use: \t\t\t%s %s %s %s %s %s %s %s# paths_non_preferred: \t\t\t%s %s %s %s %s %s %s %s# paths_invalid_cabling: \t\t%s %s %s %s %s %s %s %s# paths_cuir_quiesced: \t\t\t%s %s %s %s %s %s %s %s# paths_invalid_hpf_characteristics: \t%s %s %s %s %s %s %s %s# paths_error_threshold_exceeded: \t%s %s %s %s %s %s %s %s#\n" \ + if [[ "$ESE" == 1 ]]; then + DISCIPLINE="${DISCIPLINE} (ESE)" + fi + + printf "%s:%s:%s/%s/%s%s%s# status:\t\t\t\t%s# type: \t\t\t\t%s# blksz:\t\t\t\t%s# size: \t\t\t\t%s# blocks:\t\t\t\t%s# extent_size:\t\t\t\t%s# logical_capacity:\t\t\t%s# space_allocated:\t\t\t%s# use_diag:\t\t\t\t%s# readonly:\t\t\t\t%s# eer_enabled:\t\t\t\t%s# erplog:\t\t\t\t%s# hpf:\t\t\t\t\t%s# uid: \t\t\t\t%s# paths_installed: \t\t\t%s %s %s %s %s %s %s %s# paths_in_use: \t\t\t%s %s %s %s %s %s %s %s# paths_non_preferred: \t\t\t%s %s %s %s %s %s %s %s# paths_invalid_cabling: \t\t%s %s %s %s %s %s %s %s# paths_cuir_quiesced: \t\t\t%s %s %s %s %s %s %s %s# paths_invalid_hpf_characteristics: \t%s %s %s %s %s %s %s %s# paths_error_threshold_exceeded: \t%s %s %s %s %s %s %s %s#\n" \ "$SORTKEYLEN" "$SORTKEY" \ "$BUSID" \ "$BLOCKNAME" \ @@ -562,6 +575,9 @@ function extended() "$SSIZE" \ "$MBSIZE" \ "$BLOCKCOUNT" \ + "$EXTSZ" \ + "$CAPACITY" \ + "$ALLOCATED" \ "$DIAG" \ "$READONLY" \ "$EER" \ @@ -787,10 +803,10 @@ fi if [[ "$PRINTUID" == "true" ]] && [[ "$OUTPUT" != "old" ]]; then printf "Bus-ID Name UID\n" - printf "==============================================================================\n" + printf "================================================================================\n" elif [[ "$OUTPUT" == "new" ]]; then - printf "Bus-ID Status Name Device Type BlkSz Size Blocks\n" - printf "==============================================================================\n" + printf "Bus-ID Status Name Device Type BlkSz Size Blocks\n" + printf "================================================================================\n" elif [[ "$OUTPUT" == "extended" ]]; then PROCESSING=" $PROCESSING | sed 's/#/\n/g' " fi