fdisk can help.

Here is a little hack I named "lunsizes" that assumes up to 26 mounted
LUNs and "friendly names" (/dev/mapper/mapth<x>):

#!/bin/bash
# find LUNs in /dev/mapper and list in bytes and GiB
ls /dev/mapper/mpath[a-z] >/dev/null 2>&1
if [ $? != 0 ]; then # no LUNs found
  echo "No LUNs found in /dev/mapper/mpath*"
  exit 1
fi

echo -e "LUN               \tBytes      \t~GiB"
for nextLUN in /dev/mapper/mpath[a-z]; do
  bytes=`fdisk -l $nextLUN 2>/dev/null | grep "Disk $nextLUN" | awk
'{print $5}'`
  let GB=bytes/1024/1024/1024
  echo -e "$nextLUN \t$bytes \t$GB"
done

"Mike MacIsaac" <mikemac at-sign us.ibm.com>



From:
Thang Pham/Poughkeepsie/IBM@IBMUS
To:
[email protected],
Date:
10/09/2012 07:33 PM
Subject:
[LINUX-390] SCSI/FCP disk size
Sent by:
Linux on 390 Port <[email protected]>



Hello List,

Is there a way to find out the size of a native SCSI device attached via
FCP channel?  I do not see lszfcp or lsscsi having an option that lets you
see the size of the disk you have attached to a VM.

Thanks,
Thang Pham

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or
visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/




----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to