Re: Discover New/Unused Disks on a HP-UX 11i v3 system (2086 Views)
Reply
Frequent Advisor
ashutosh99
Posts: 43
Registered: ‎12-04-2012
Message 1 of 7 (2,105 Views)
Accepted Solution

Discover New/Unused Disks on a HP-UX 11i v3 system

Hi Guys,

 

I'm looking for a shortcut to identify all the disks on a system, which are in use by either LVM, HPVM or any other process.

I also need to identify all the disks, which are unused by any of the processes.

 

Is there a simple way to do this instead of scanning through all the applications for the disk used b them like. LVM, HPVM, Oracle RAC or VXVM?

 

It'll be huge relief if someone has a custom script to do this job for me. 

 

Thanks,

Ashutosh

Acclaimed Contributor
Torsten.
Posts: 23,450
Registered: ‎10-02-2001
Message 2 of 7 (2,104 Views)

Re: Discover New/Unused Disks on a HP-UX 11i v3 system

This can be hard.

>> LVM, HPVM or any other process.

"any other process" is the problem, if some applications are using raw disks ...

Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Honored Contributor
Duncan Edmonstone
Posts: 5,684
Registered: ‎08-05-2000
Message 3 of 7 (2,086 Views)

Re: Discover New/Unused Disks on a HP-UX 11i v3 system

on 11.31 we have the diskowner command - see man page for details

 

something like:

 

for i in /dev/disk/*

do

diskowner $i

done

 

would be a simple way to accomplish what you need - not sure what it will show for disks owned by HPVM guests though

 

the list of what it can recognise is described in the man page


HTH

Duncan
Acclaimed Contributor
Torsten.
Posts: 23,450
Registered: ‎10-02-2001
Message 4 of 7 (2,079 Views)

Re: Discover New/Unused Disks on a HP-UX 11i v3 system

[ Edited ]

Interesting command.

diskowner
displays the following possible output:
owner
The owner of the given path.
owner
can be one of the following:

 

none   The path is not owned by any known subsystem.
lvm     The path is part of an LVM volume group.
vxvm  The path is part of a VxVM volume group.
vxfs    The path has a VxFS filesystem on it.
hfs      The path has a HFS filesystem on it.
swap  The path is being used as a swap device.
dump The path is being used as a dump device.
asm The path is part of an Oracle database.
partition  The path has EFI partitions on it.

http://h20565.www2.hp.com/portal/site/hpsc/template.BINARYPORTLET/public/kb/docDisplay/resource.proc...


I don't thing it can detect any HPVM or "raw" disks.

 

Example:

 

 

#diskowner /dev/disk/disk2_p2
Path /dev/disk/disk2_p2 is owned by lvm.
#diskowner /dev/rdisk/disk10
Path /dev/rdisk/disk10 is owned by vxvm. -

Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Honored Contributor
Bill Hassell
Posts: 14,221
Registered: ‎05-29-2000
Message 5 of 7 (2,062 Views)

Re: Discover New/Unused Disks on a HP-UX 11i v3 system

[ Edited ]

Raw disks are problematic in that there no magic number or ID for every possible application. You can try examining the first few kbytes of the unknown disks for a possible ID string. Use xd to show the binary and ASCII strings:

# xd -txc -N 200 /dev/rdisk/disk4

and to offset into the raw disk, -j can be used as an offset.

# xd -txc -N 200 -j 1000 /dev/rdisk/disk4

Here's an example showing an LVM disk:

# xd -txc -N 200 -j 8192 /dev/rdisk/disk18
0000000         4c564d52        45433031        66e5f3ed        519bc06b
           L   V   M   R   E   C   0   1   f 345 363 355   Q 233 300   k
0000010         66e5f3ed        519bc321         10f59c7               0
           f 345 363 355   Q 233 303   ! 001 017   Y 307  \0  \0  \0  \0

LVMREC01 identifies this disk as in use by LVM version 1.0.

 Also look to see if the disk device files are not owned by root. And any disk that has partitions is likely to have (or had in the past) some boot areas or other specialized usage.

 

I don't allow any raw disks to be used until they are recorded in fstab as comments. Whether the application is Sybase, Informix or some homegrown rpogram, raw disks are always at risk when sysadmins change and don't document unusual configs..

Frequent Advisor
ashutosh99
Posts: 43
Registered: ‎12-04-2012
Message 6 of 7 (2,043 Views)

Re: Discover New/Unused Disks on a HP-UX 11i v3 system

Hi All,

 

Thanks for your valuable input. I got my answer in diskowner command. I didn't even know something like this was already present in HP-UX. Next I saw that the boot disks of all the HPVMs are said as "owned by partition". The other disks presented to HPVM, which were used by LVM, were surprisingly shown as "owned by lvm". I didn't knew that disks presented to a HPVM and then used by LVM could be identified from the VM Host.

 

I couldn't verify for disks in use by Oracle RAC, Veritas Volume Manager & other systems accessing the disks directly. If anyone can do that, it would be immensly useful for all of us.

 

Thanks again for all the help.

 

Regards,

Ashutosh Singh

Honored Contributor
likid0
Posts: 981
Registered: ‎03-01-2005
Message 7 of 7 (1,996 Views)

Re: Discover New/Unused Disks on a HP-UX 11i v3 system

This is a very old thread, but just to metion that you can look at the header of ASM disks and script it:

 

For example:

 

    check_ASM=`od -c $device |head -10|grep "O   R   C   L   D   I   S   K"|awk '{print$2,$3,$4,$5,$6,$7,$8,$9}'`

Windows?, no thanks
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.