Operating System - HP-UX
1834098 Members
2377 Online
110063 Solutions
New Discussion

Re: ioscan output formatting...

 
SOLVED
Go to solution
Gene Laoyan
Super Advisor

ioscan output formatting...

When I do an ioscan -fnC disk I get the following output of disk(s)...

disk 27 0/0/6/1/0.1.25.0.0.1.2 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t1d2 /dev/dsk/c7t1d2s2 /dev/rdsk/c7t1d2 /dev/rdsk/c7t1d2s2
/dev/dsk/c7t1d2s1 /dev/dsk/c7t1d2s3 /dev/rdsk/c7t1d2s1 /dev/rdsk/c7t1d2s3
disk 28 0/0/6/1/0.1.25.0.0.1.3 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t1d3 /dev/dsk/c7t1d3s2 /dev/rdsk/c7t1d3 /dev/rdsk/c7t1d3s2
/dev/dsk/c7t1d3s1 /dev/dsk/c7t1d3s3 /dev/rdsk/c7t1d3s1 /dev/rdsk/c7t1d3s3

How can I make my output ommit the "s2" or "s3" lines? I don't really need to see them. I really only want the output to look like this...

disk 36 0/0/6/1/0.1.25.0.0.2.7 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t2d7 /dev/rdsk/c7t2d7
disk 37 0/0/6/1/0.1.25.0.0.3.0 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t3d0 /dev/rdsk/c7t3d0
disk 38 0/0/6/1/0.1.25.0.0.3.1 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t3d1 /dev/rdsk/c7t3d1

Thanks


12 REPLIES 12
Calandrello
Trusted Contributor

Re: ioscan output formatting...

Friend
tries ioscan -fnC disk |grep -v argument that must be ommit of output
Pete Randall
Outstanding Contributor

Re: ioscan output formatting...

Simple answer:

ioscan -fnC disk |grep -v s2 |grep -v s3

That may well be too simple an approach, but, given your example, it works.


Pete

Pete
Gene Laoyan
Super Advisor

Re: ioscan output formatting...

Ok, now I get this...

disk 27 0/0/6/1/0.1.25.0.0.1.2 sdisk CLAIMED DEVICE NETAPP LUN
disk 28 0/0/6/1/0.1.25.0.0.1.3 sdisk CLAIMED DEVICE NETAPP LUN
disk 29 0/0/6/1/0.1.25.0.0.1.4 sdisk CLAIMED DEVICE NETAPP LUN

Noy I can't see my device files.
Sandman!
Honored Contributor

Re: ioscan output formatting...

Do you have slices on your LUNs? If not then you can remove "rmsf " the corresponding device files and try the ioscan again. The grep won't work unless the lines containg the unwanted string is isolated to particular line(s).
Pete Randall
Outstanding Contributor

Re: ioscan output formatting...

Hmmmm, it's taking out the whole line. I'm thinking you would have to do some fancy awk manipulating to get what you want. My awk skills aren't all that great, but I'll start experimenting and see if I can come up with something before one of our awk experts does.


Pete

Pete
Patrick Wallek
Honored Contributor

Re: ioscan output formatting...

Unless you want to totally redo the ioscan output with awk or sed, then I don't think this is possible.

Gene Laoyan
Super Advisor

Re: ioscan output formatting...

By slices, do you mean partitioned?
These LUN's are raw disks assigned Windows Virtual MAchines. Yes, there are partitions on them but only one.
I don't mind using awk, I use it on other commands, however, I have only been an HP-Unix admin since the end of July and I rely on asking questions on the forum. So any responses from anyone on this is very much appreciated.

Thanks
Sandman!
Honored Contributor
Solution

Re: ioscan output formatting...

Try the awk construct below and see if it works for you:

# ioscan | awk '{for(i=1;i<=NF;++i){if($i!~"s[0-9]+$") printf("%s ",$i)} print ""}'

~cheers
Gene Laoyan
Super Advisor

Re: ioscan output formatting...

PERFECT!

Thanks!

Now there's less clutter of stuff for me. Here's the output...

disk 36 0/0/6/1/0.1.25.0.0.2.7 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t2d7 /dev/rdsk/c7t2d7
disk 37 0/0/6/1/0.1.25.0.0.3.0 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t3d0 /dev/rdsk/c7t3d0
disk 38 0/0/6/1/0.1.25.0.0.3.1 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t3d1 /dev/rdsk/c7t3d1

Thanks again!
Patrick Wallek
Honored Contributor

Re: ioscan output formatting...

My question to you is -- If these devices from teh Netapp are assigned to Windows Virtual Machines, why is the HP-UX machine even aware of them?

They should be assigned to the Windows machine ONLY. Having them available to HP-UX is only asking for trouble, in my opinion. It would be very easy to do a 'pvcreate' on one of those disks and thus blow up your Windows VM.
Gene Laoyan
Super Advisor

Re: ioscan output formatting...

We're using Integrity Virtual Machine 2.0 to host Windows Virtual Machines. Each Windows VM requires a disk so we use a fiber LUN as a disk and assign the /dev/rdsk/cXtYdZ to the integrity virtual machine guest. The guest sees the fiber lun as a physically attached disk. Never sees fiber anything. On the HP-UX hosts there are only three device files that we use for the system, the DVD and the two hard drives that are in a mirror. Any LUN's from fiber are not touched for anything nor mounted to anything but an Integrity VM. It is not possible for any Wondoze machine to see anything in our fabric. However, LUN management is a big pan in the uknow what.
Gene Laoyan
Super Advisor

Re: ioscan output formatting...

Besides, after everything is all setup, there is no reason to pvcreate EVER in any of the 4 partitions of our rx8640. All we need is a default install of HP-Unix, patched of course, and Integrity Virtual Machine.