Operating System - HP-UX
1754420 Members
2550 Online
108813 Solutions
New Discussion юеВ

Script to check, if the luns are associated with any volume group/disk group

 
SOLVED
Go to solution
HP-UX_Ali
Regular Advisor

Script to check, if the luns are associated with any volume group/disk group

Hello All,

Required your help in finding out, if any EVA/XP luns is associated with volumegroup/diskgroup (LVM/Veritas).

Scenario: We have many HPUX servers, where EVA/XP luns as been assigned in numbers. the issue is many a times, admin has removed the volume group / diskgroup which was associated to it and didn't updated the storage team for reclaming back. From storage end, admin can only see it is assigned to server but from server end it is very difficult to find a particluar lun is used or not..

Kindly help to overcome in this scenario...


Regards
Ali...
9 REPLIES 9
Kenan Erdey
Honored Contributor

Re: Script to check, if the luns are associated with any volume group/disk group

Hi,

from the host side utulities like xpinfo and evainfo gives lun names which you can see from eva and xp. This supplies you mapping between storage and host.

if a disk is used in LVM, pvdisplay /dev/dsk/xxx gives the information whether is lun is associated to a Volume group.
Computers have lots of memory but no imagination
James R. Ferguson
Acclaimed Contributor

Re: Script to check, if the luns are associated with any volume group/disk group

Hi:

> but from server end it is very difficult to find a particluar lun is used or not

This underscores the need to *document* exactly for what a disk device is used and to track (by documentation) what physical devices are available for reuse.

For example, If the physical disk was once used by LVM, but then 'vgexport'ed to eliminate the volume group that once encapsulated it, you will have a PVID and a VGID written on it. You can read this, but whether or not the disk contains anything that you value is uncertain.

In a case like this, you can create a temporary volume group, 'vgimport' the physical disk(s) in question; and mount any and all logical volumes in it on directories of your choice. You can then examine the disk for any data that might be useful.

Again, there is no substitute for good documentaton!

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Script to check, if the luns are associated with any volume group/disk group

Hi (again):

To query a physical disk for any LVM metadata, you can use the script that I posted in the thread below to discover the PVID and VGID:

http://h30499.www3.hp.com/t5/LVM-and-VxVM/vgchgid-question/m-p/4110232#M31208


Regards!

...JRF...

VK2COT
Honored Contributor

Re: Script to check, if the luns are associated with any volume group/disk group

Hello,

Apart from all sorts of scripts and methods
to check physical disks on HP-UX, the most
elegant one that I found was dskinfo (internal
HP-UX tool).

Here is part of what dskinfo can show:

Disk check summary (dir "/dev/rdisk"):

device type model lba EFI FAT LIF LVM HFS VxVM VxFS
disk3 DISK ST373454LC 71687369 X _ _ _ _ _ _
disk3_p1 DISK ST373454LC 511968 _ X _ _ _ _ _
disk3_p2 DISK ST373454LC 70765568 _ _ X X _ _ _
disk3_p3 DISK ST373454LC 409600 _ X _ _ _ _ _
disk5 DISK ST373454LC 71687369 _ _ _ X _ _ _
disk8 DISK ST373454LC 71687369 _ _ _ X _ _ _
disk9 DISK ST373454LC 71687369 X _ _ _ _ _ _
disk9_p1 DISK ST373454LC 511968 _ X _ _ _ _ _
disk9_p2 DISK ST373454LC 70766592 _ _ X X _ _ _
disk9_p3 DISK ST373454LC 408736 _ X _ _ _ _ _

Alas, this tool is not available externally.

As a Unix Ambassador at HP, I have been pushing for it to be part of a regular OS.

The other one is diskowner(1M):

# diskowner -FA

Some examples of what it shows:

path=/dev/rdsk/c1t2d0:error=path_has_ioerror
path=/dev/dsk/c0t6d0s2:LVM_Disk=yes
path=/dev/rdsk/c0t6d0s2:owner=lvm
path=/dev/rdisk/disk6:owner=lvm.vxfs

The last entry above is for a disk that belongs to VxVM (lvm.vxfs).

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Doug O'Leary
Honored Contributor
Solution

Re: Script to check, if the luns are associated with any volume group/disk group

Hey;

Here's what I use. It identifies both HP LVM and Vxvm usage and it's called by:

evainfo | parse_evainfo | tee parsed

and results in an output similar to the following.

Ary Wwn Size CTDs VG
=======================================================
DF20 0314 35840.00 c10t0d1 c12t0d1 vgsapdataE2T
DF20 0319 35840.00 c10t0d2 c12t0d2 vgsapdataE2T
[[snip]]
DF20 03CE 35840.00 c10t6d4 c12t6d4 vgsapdata1E2T
DF20 03D2 35840.00 c10t6d7 c12t6d7 vgsapdata1E2T
[[snip]]
DF20 04A5 35840.00 c10t10d1 c12t10d1 vgsapE2T
DF20 04AA 35840.00 c10t10d2 c12t10d2 vgsapE2T
[[snip]]
DF20 064A 35840.00 c10t12d2 c12t12d2 vgsapdata2E2T
DF20 064E 35840.00 c10t12d1 c12t12d1 vgsapdata2E2T
DF20 0652 35840.00 c10t11d7 c12t11d7 [[snip]]
DF20 068B 35840.00 c10t13d4 c12t13d4 vgsapdata3E2T
DF20 0690 35840.00 c10t13d5 c12t13d5 vgsapdata3E2T
[[snip]]
DF20 06AE 35840.00 c10t14d3 c12t14d3 Unassigned
DF20 06B3 35840.00 c10t14d4 c12t14d4 Unassigned
DF20 06B8 35840.00 c10t14d5 c12t14d5 Unassigned
DF20 06BD 35840.00 c10t14d6 c12t14d6 Unassigned

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
HP-UX_Ali
Regular Advisor

Re: Script to check, if the luns are associated with any volume group/disk group

Thanks Doug..


Regards
chindi
Respected Contributor

Re: Script to check, if the luns are associated with any volume group/disk group

Hi Doug ,
When m running as per ur suggestion m gettng the follwing o/p ;


/usr/bin/evainfo -a|/usr/bin/parse_evainfo|tee parsed

Sym CuLdev Size CTDs VG
=======================================================
Alex_lbb_1
Visitor

Re: Script to check, if the luns are associated with any volume group/disk group

hi
Doug O'Leary
evainfo | parse_evainfo | tee parsed

and results in an output similar to the following.

Ary Wwn Size CTDs VG
=======================================================
DF20 0314 35840.00 c10t0d1 c12t0d1 vgsapdataE2T
DF20 0319 35840.00 c10t0d2 c12t0d2 vgsapdataE2T
##################
i install evainfo but i cannt find parse_evainfo ?

Doug O'Leary
Honored Contributor

Re: Script to check, if the luns are associated with any volume group/disk group

hey;

The parse_evainfo is the script that's attached to my post a few entries up. save that as parse_evainfo and you're done.

Doug

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