Operating System - HP-UX
1748242 Members
4118 Online
108760 Solutions
New Discussion юеВ

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

 
Go to solution
ashutosh99
Frequent Advisor

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

6 REPLIES 6
Torsten.
Acclaimed Contributor

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!   
Solution

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


I am an HPE Employee
Accept or Kudo
Torsten.
Acclaimed Contributor

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

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.process/?spf_p.tpst=kbDocDisplay_ws_BI&spf_p.rid_kbDocDisplay=docDisplayResURL&javax.portlet.begCacheTok=com.vignette.cachetoken&spf_p.rst_kbDocDisplay=wsrp-resourceState%3DdocId%253Demr_na-c02259496-2%257CdocLocale%253D&javax.portlet.endCacheTok=com.vignette.cachetoken


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!   
Bill Hassell
Honored Contributor

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

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..



Bill Hassell, sysadmin
ashutosh99
Frequent Advisor

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

likid0
Honored Contributor

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