Storage Boards Cleanup
To make it easier to find information about HPE Storage products and solutions, we are doing spring cleaning. This includes consolidation of some older boards, and a simpler structure that more accurately reflects how people use HPE Storage.
Disk Arrays
Showing results for 
Search instead for 
Did you mean: 

HP -ux command

Occasional Visitor

HP -ux command

please let me know hp-ux command to know
1)total number of external disks assigned and their capacity(used and free)

Leif Halvarsson_2
Honored Contributor

Re: HP -ux command

The easiest is to use SAM, start SAM, open Disk and Fils system and then open Disks.

If you like commands you ca´n try:
ioscan -fnC disk

From the list of disks you can then do:
ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
disk 0 0/0/1/1.15.0 sdisk CLAIMED DEVICE FUJITSU MAJ3091MC
/dev/dsk/c1t15d0 /dev/rdsk/c1t15d0
disk 15 0/2/0/ sdisk CLAIMED DEVICE CMD CRD-7400
/dev/dsk/c10t15d0 /dev/rdsk/c10t15d0
disk 16 0/2/0/ sdisk CLAIMED DEVICE CMD CRD-7400
/dev/dsk/c10t15d1 /dev/rdsk/c10t15d1
disk 17 0/2/0/ sdisk CLAIMED DEVICE CMD CRD-7400
/dev/dsk/c10t15d2 /dev/rdsk/c10t15d2
disk 18 0/2/0/ sdisk CLAIMED DEVICE CMD CRD-7400
/dev/dsk/c10t15d3 /dev/rdsk/c10t15d3
# diskinfo /dev/rdsk/c1t15d0
SCSI describe of /dev/rdsk/c1t15d0:
vendor: FUJITSU
product id: MAJ3091MC
type: direct access
size: 8923743 Kbytes
bytes per sector: 512
Mic V.
Esteemed Contributor

Re: HP -ux command

Adding to the above: the EMC utility "inq" does an excellent job. It used to be free, but I can't find it any more.

diskinfo gives capacity, but will not give used/free. To get used/free, it's more complicated and depends on whether you're using LVM or "whole disk."

If whole disk, I believe that when you do a bdf, one filesystem will equate to one disk (you can see the mapping by looking at /etc/fstab or running the mount command with no arguments). However, this is theoretical to me; I've not done whole disk.

For LVM disks, I think a reasonable answer is to get the list of disks (using ioscan or inq; you can see which ones are actually in use by "vgdisplay -v" or "strings /etc/lvmtab" but you'll need to know how to interpret the results of the commands). Once you have a list of disks currently used by volume groups, do a "pvdisplay -v disk_name" where you replace "disk_name" with a disk device filename. Raw, as I recall:

/usr/sbin/pvdisplay -v /dev/rdsk/c0t5d0

"man pvdisplay" will answer questions. Once you see the information, you have to count the physical extents. pvdisplay shows the status of every physical extent in the volume group. The heading of the pvdisplay command (or else the vgdisplay for the appropriate volume group) shows the extent size. You count the number of free extents, multiply extent size, and there's the amount free. Count the number of extents in use (it will show something like "lvol2") and do the calculation.

As far as determining which are external, I don't know of a programmatic way. It depends on the hardware path. Each type of server has certain built-in bus paths. Disks on those busses should be internal drives (unless it's a bus with an adapter on that's externally exposed, such as a D or K class, and you've hung a disk/array off it).


What kind of a name is 'Wolverine'?
Sanjay Kumar Suri
Honored Contributor

Re: HP -ux command

I am not sure if bdf command serve your need. It gives the following info:

Filesystem kbytes used avail %used Mounted on

A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.