Operating System - HP-UX
1833875 Members
2782 Online
110063 Solutions
New Discussion

Finding physical disk drives on a HP-UX machine

 
Vineet Deshpande
Frequent Advisor

Finding physical disk drives on a HP-UX machine

Hi,

I want to find information about the disk drives mounted on a HP-UX system. I only want physical devices and not logical devices.

Right now I am using the command:-
echo "selclass qualifier hard; info;wait;infolog" 2>/dev/null | /usr/sbin/cstm 2>/dev/null

But this command gives me logical volumes also while I want only physical disk drives.

Please help.

Vineet
10 REPLIES 10
Ivan Krastev
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

Use ioscan:

ioscan -fnC disk

regards,
ivan
Vineet Deshpande
Frequent Advisor

Re: Finding physical disk drives on a HP-UX machine

Hi Ivan,

ioscan command requires "root" privileges. Is there any command available which works for a normal user?

Thanks,

Vineet
Wouter Jagers
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

Hiya,

Try ioscan -fnkCdisk

Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
Jeeshan
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

hi

the above reply's doesn't outcome any result unless you hav proper permission in ioscan fommand file.

try this
#cat /var/adm/syslog|grep disk|more

this will give you the hardware address of disks.

BTW you post in in wrong forum.
a warrior never quits
Vineet Deshpande
Frequent Advisor

Re: Finding physical disk drives on a HP-UX machine

Hi Ahsan,

Please tell me in which forum I should post my query.

Thanks,

Vineet
Wouter Jagers
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

I've just checked, and this works as a non-root user:

# /sbin/ioscan -fnkCdisk

Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
Johnson Punniyalingam
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

Hi Vineet,

Try this has "root -user"

run following commands.


ioscan -funCdisk|grep dsk|awk '{print $1}'|xargs -i pvdisplay {}


if there is any PV which is not associated with any VG it give error for that PV ptherwise shows information like :

--- Physical volumes ---
PV Name /dev/dsk/c3t15d0
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 2
PE Size (Mbytes) 4
Total PE 8681
Free PE 0
Allocated PE 8681
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Problems are common to all, but attitude makes the difference
Doug O'Leary
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

Hey;

ioscan only requires root if you're actually scanning the bus.

Use either of the following commands:

ioscan -funC disk
ioscan -fknC disk

will work for non-root users and will display the ctds (or dsf as HP likes to call 'em) for the disks.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Bill Hassell
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

The -k option in ioscan will not perform a new hardware search (which requires root). The -k also runs ioscan instantly which is quite useful.

> But this command gives me logical volumes also while I want only physical disk drives.

cstm knows nothing about logical volumes, it is showing you physical disks. This includes disks that have never been written or incorporated into a volume group. The more common command for disk is:

echo "selclass qualifier hard;info;wait;infolog"|cstm

However, cstm is very wordy (lots of details). You can filter cstm like this:

echo "selclass qualifier hard;info;wait;infolog" | cstm | grep "Product Id:"

But then ioscan -kfCdisk provides one-liners with a bit more information per line.


Bill Hassell, sysadmin
Suraj K Sankari
Honored Contributor

Re: Finding physical disk drives on a HP-UX machine

Hi,

You can use ioscan command if you have the root permission or ask your administrator to give sudo permission to run this command.

Suraj