- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ioscan format
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 01:19 AM
05-11-2009 01:19 AM
ioscan format
I am doing #ioscan -funC tape on my server, and I get the following output.
Class I H/W Path Driver S/W State H/W Type Description
==========================================================================
tape 39 0/2/0/0.22.0.255.0.6.0 atdd CLAIMED DEVICE IBM ULT3580-TD3
/dev/rmt/39m /dev/rmt/39mnb /dev/rmt/c151t6d0BESTn
/dev/rmt/39mb /dev/rmt/c151t6d0BEST /dev/rmt/c151t6d0BESTnb
/dev/rmt/39mn /dev/rmt/c151t6d0BESTb
tape 46 0/2/0/0.22.0.255.0.7.0 atdd CLAIMED DEVICE IBM ULT3580-TD3
/dev/rmt/46m /dev/rmt/46mnb /dev/rmt/c151t7d0BESTn
/dev/rmt/46mb /dev/rmt/c151t7d0BEST /dev/rmt/c151t7d0BESTnb
/dev/rmt/46mn /dev/rmt/c151t7d0BESTb
tape 27 0/2/0/0.22.0.255.1.0.0 atdd CLAIMED DEVICE IBM ULT3580-TD3
/dev/rmt/27m /dev/rmt/27mnb /dev/rmt/c152t0d0BESTn
/dev/rmt/27mb /dev/rmt/c152t0d0BEST /dev/rmt/c152t0d0BESTnb
/dev/rmt/27mn /dev/rmt/c152t0d0BESTb
tape 37 0/2/0/0.22.0.255.1.1.0 atdd CLAIMED DEVICE IBM ULT3580-TD3
/dev/rmt/37m /dev/rmt/37mnb /dev/rmt/c152t1d0BESTn
/dev/rmt/37mb /dev/rmt/c152t1d0BEST /dev/rmt/c152t1d0BESTnb
/dev/rmt/37mn /dev/rmt/c152t1d0BESTb
tape 38 0/5/0/0.22.0.255.0.10.0 atdd CLAIMED DEVICE IBM ULT3580-TD3
/dev/rmt/38m /dev/rmt/c150t10d0BEST
/dev/rmt/38mb /dev/rmt/c150t10d0BESTb
/dev/rmt/38mn /dev/rmt/c150t10d0BESTn
/dev/rmt/38mnb /dev/rmt/c150t10d0BESTnb
tape 44 0/5/0/0.22.0.255.0.11.0 atdd SCAN DEVICE IBM ULT3580-TD3
/dev/rmt/44m /dev/rmt/c150t11d0BEST
/dev/rmt/44mb /dev/rmt/c150t11d0BESTb
/dev/rmt/44mn /dev/rmt/c150t11d0BESTn
/dev/rmt/44mnb /dev/rmt/c150t11d0BESTnb
You can see here, some of the dvices have 3 columns of device files and some has two columns. And this behaviour is not persistent, it changes. Sometimes, all of them listed in 3 columns. Because of this inconsistency, my scripts are picking wrong fields. Could someone tell me how can I make sure ioscan lists devices in same format each time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 01:21 AM
05-11-2009 01:21 AM
Re: ioscan format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 01:25 AM
05-11-2009 01:25 AM
Re: ioscan format
>>my scripts are picking wrong fields.
Can you let me know which fields you are picking from your script.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 01:33 AM
05-11-2009 01:33 AM
Re: ioscan format
FDor example, if you take first TWO devices, I need to pick something like this.
39mnb 151 6 0
46mnb 151 7 0
See, I can get around the problem by grepping and filtering,etc from ioscan output. But it will be easy, if ioscan lists all tape devices in same format everytime. I can't see a reason why ioscan should list differently, because all tape devices have got same number of devices, same sort of FC paths. May be something to do with the terminal window size, but probably there is a way to fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 01:55 AM
05-11-2009 01:55 AM
Re: ioscan format
I guess one of our awk or perl gurus should be ablt to give you a method of getting this output 100% consistent (maybe just one device file per line?)
However, what about approaching the problem from a different direction:
lssf /dev/rmt/*mnb | grep -v '???'
will give you a list of valid devices and hardware paths for the /dev/rmt/Xmnb devices, and:
lssf /dev/rmt/c*t*d*BESTnb | grep -v '???'
will get you a similar list - now you just need to compare hardware paths between the 2 outputs to match up. The output of lssf is much more consistent.
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 02:01 AM
05-11-2009 02:01 AM
Re: ioscan format
Here is the script
ioscan -fnC tape >/tmp/data
awk '{if (substr($0,13,2)==" /")
{
a=substr($0,23,5)
b=substr($0,39,3)
c=substr($0,43,1)
print a" "b" "c
}
}'
copy this lines into a file
sh myfile
39mnb 151 6
46mnb 151 7
27mnb 152 0
37mnb 152 1
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 02:06 AM
05-11-2009 02:06 AM
Re: ioscan format
Forget to print the last 0 as said by you last field be always 0 (Zero)
Insted of this line
print a" "b" "c
use this line
print a" "b" "c" "0
output will be
39mnb 151 6 0
46mnb 151 7 0
27mnb 152 0 0
37mnb 152 1 0
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 04:32 AM
05-11-2009 04:32 AM
Re: ioscan format
I have tried that, didn't work. if I read it correctly, Your script is again depends on the charecter positions in ioscan output and the number of charecters on the output. If that is the case it doesn't work, because ioscan output changes each time. for eg. I have ran an #ioscan -funC tape now, it is showing all the devices in 3 columns. My logic is working when all the devices are listed in 3 columns, it breaks when the format changes.
awk '{if ($0~/tape/){gsub(/\./," ");id1=$8; id2=$9;} else if($0~/mnb/){gsub(/\//," ");sub(/c/,"");sub(/t[0-9]/," ");print $6, $9, id1, id2}}'
I am really looking for why ioscan shows one format in the morning, another format in the afternoon.
TIA
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 05:23 AM
05-11-2009 05:23 AM
Re: ioscan format
Some quick playing around showed that if you adjust the COLUMNS environment variable, it changes the output of ioscan.
So try running:
export COLUMNS=4096
ioscan -funC tape
Rememeber to reset COLUMNS appropriately after the ioscan is run.
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 05:29 AM
05-11-2009 05:29 AM
Re: ioscan format
I agree. I have tried COLUMNS=80 & COLUMNS=100, and the output shows different. So, for the timebeing I have added this variable in the script and slightly adjusted the fields in awk. So, it is working, but not sure howlong. Because it is being working for sometime and then broken, fixed,broken... So, will keep quiet now until it breaks next time.
Thanks
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 10:20 AM
05-11-2009 10:20 AM
Re: ioscan format
something like "ioscan -FunC tape"????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 11:50 AM
05-11-2009 11:50 AM
Re: ioscan format
Probably cos the lines he's interested in aren't effected by the "-F" option - that does compact all the output *except* for the device file information, which is still displayed on seperate lines
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2009 12:24 PM
05-11-2009 12:24 PM
Re: ioscan format
ahh..wasn't aware of that....should've looked..thanks for the info