Operating System - HP-UX
1834154 Members
2499 Online
110064 Solutions
New Discussion

Re: How to identify the unused disks using commandline utilities

 
durairaj
New Member

How to identify the unused disks using commandline utilities

Hello All,

I have the problem on HPUX 11.23 machine when I use the pvreate command to add new hard disk.

# ioscan -fnC disk

Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c2t0d0 /dev/dsk/c2t0d0s2 /dev/rdsk/c2t0d0 /dev/rdsk/c2t0d0s2
/dev/dsk/c2t0d0s1 /dev/dsk/c2t0d0s3 /dev/rdsk/c2t0d0s1 /dev/rdsk/c2t0d0s3
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c2t1d0 /dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s1 /dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s1 /dev/rdsk/c2t1d0s3

Actually I have to add disk 2. I used pvcreate command to create physical volume path /dev/rdsk/c2t0d0. But this is one curently used. The pvcreate command didn't give even warnings. I should be create /dev/rdsk/c2t1d0 instead /dev/rdsk/c2t0d0. Now I reboot the machine & its not working.

My doubt is, how can I know the physical path( /dev/rdsk/c2t0d0) is used currently? How to identify the unused disks using commandline utilities?

Regs,
Durai.
7 REPLIES 7
Mark Grant
Honored Contributor

Re: How to identify the unused disks using commandline utilities

Check this link

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=602666

The script I posted in there has always worked for me but I don't actually guarantee it :)

You can't beat good documentation on what disk is where.

Basically though, pvcreate should complain if the disk is in a volume group but "pvcreate -f" won't. I make it a mission of mine, never to have to use "pvcreate -f"
Never preceed any demonstration with anything more predictive than "watch this"
Robert-Jan Goossens
Honored Contributor

Re: How to identify the unused disks using commandline utilities

Hi Durai,

You can use the pvdisplay command to check the disk for vg configuration.

# vgdisplay /dev/dsk/cxtydz

Regards,
Robert-Jan
Ravi_8
Honored Contributor

Re: How to identify the unused disks using commandline utilities

Hi Durai,

Find the volume groups exist and issue the command
#vgdisplay -v vgxx shows the disk used for that volume group

and also
#lvlnboot -v
never give up
Isralyn Manalac_1
Regular Advisor

Re: How to identify the unused disks using commandline utilities

You must check disk association to a VG using vgdisplay -v VGname. Another way to check this is through:

#strings /etc/lvmtab|grep /dev/dsk/cXtXdX

or just run "strings /etc/lvmtab" and compare it with the output of "ioscan -funC disk"

Just a tip. What I do is to collect SIR data (ask HP Solution Center or if you have a TAM/ASE, ask for SIR) regularly so I have proper documentation of the system configuration and information of all my HPUX machines. I can tell you that it has been a handy tool for me for more than a couple of instances.

Regards,

Ira
Isralyn Manalac_1
Regular Advisor

Re: How to identify the unused disks using commandline utilities

ooops...I also forgot to mention about pvdisplay /dev/dsk/cXtXdX

Regards,

Ira
Robert-Jan Goossens
Honored Contributor

Re: How to identify the unused disks using commandline utilities

Hi,

Sorry for the condusion I made :-)

use
# pvdisplay /dev/dsk/cxtydz

db001:/root# pvdisplay /dev/dsk/c5t5d0
--- Physical volumes ---
PV Name /dev/dsk/c5t5d0
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 6
PE Size (Mbytes) 4
Total PE 4340
Free PE 0
Allocated PE 4340
Stale PE 0
IO Timeout (Seconds) default

Kind regards,
Robert-Jan
Dietmar Konermann
Honored Contributor

Re: How to identify the unused disks using commandline utilities

Durai,

the question is how you define the terms "used currently" or "unused disks".

If you simply want to know if the device is LVM-configured, then pvdisplay could be used... but what if the VG is deactived?

You could look at lvmtab... but what if it's an alternate path to a configured device?

You could look at the disk's content and check for some magics that identify it as LVM or VxVM disk.

But what about devices that directly accessed by e.g. a DB. What about disks with EFI header at the beginning? I think, there's no 100% sure way to tell "unused".

However, you could use the script I attached. It scans all accessible devices on a given list of systems and tries to guess it's usage (LVM vs. VxVM vs. EFI). Especially for SAN's a multi-node scan with this script could be very helpful.

Best regards...
Dietmar.

"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)