Operating System - HP-UX
1833159 Members
3077 Online
110051 Solutions
New Discussion

Re: How to ignore the CD-ROM

 
SOLVED
Go to solution
Paul Middleton
Frequent Advisor

How to ignore the CD-ROM

Greetings from snowed in Cleveland,
.
I'm looking for some help on a short script I'm writing. I'm trying to get a total of the disk space on a system, internal and external. The problem is it keeps hanging trying to get information from the CD-ROM. I'm using ioscan to find the disks, then diskinfo for the size.
.
Any ideas would be greatly appreciated.
.
Paul Middleton
Dilligad - Do I Look Like I Give A Damn
6 REPLIES 6
Cheryl Griffin
Honored Contributor
Solution

Re: How to ignore the CD-ROM

Paul,
What is your script doing?

If you use ioscan -fnC disk, the cd-rom will appear like the following with cd-rom in the description:
disk 11 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5701T
A

Your script should test if the description has CD-ROM and skip that line if it does.
Cheryl
"Downtime is a Crime."
T. M. Louah
Esteemed Contributor

Re: How to ignore the CD-ROM

If you are reading from ioscan :
# ioscan -fnC disk |more
Class I H/W Path Driver S/W State H/W Type Description
=========================================================================
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE SEAGATE ST39103LC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 1 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 304
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0

# ioscan -fnC disk |grep -v DVD-ROM
will ignore the DVD-ROM

Cheers,
T??
Little learning is dangerous!
Paul Middleton
Frequent Advisor

Re: How to ignore the CD-ROM

Cheryl & T.M.
.
You solved my problem, now I'm using ioscan -kC disk | grep -v CD-ROM
.
The -kC disk is looking at the kernel info so I won't disturb the operation by accidently causing any forced attachments, and by not using the -f, I don't get the full display.
.
Actually, I found my biggest problem was misspelling a command. (Think in unix, type in English).
.
Thanks for your time.
.
Paul Middleton
By the way, we have 6 inches of "Partly Cloudy with a chance of blowing snow" here in Cleveland.
Dilligad - Do I Look Like I Give A Damn
Cheryl Griffin
Honored Contributor

Re: How to ignore the CD-ROM

Good job.

That was one massive storm system that moved across the states. Last week we had spring like temps. Sunday we had a light dusting of snow. Try to stay warm.
Cheryl
"Downtime is a Crime."
T. M. Louah
Esteemed Contributor

Re: How to ignore the CD-ROM

Hey Paul,
Cheryl & I were talking about how we gonna split the points .. I think u r a fair dude!
PAP! (a.k.a pliz assign points)
Little learning is dangerous!
Michael Tully
Honored Contributor

Re: How to ignore the CD-ROM

Hi Paul,

Greetings from sunny Sydney....
no snow here....

Have a look at some of the offerings from the two sysadmin scripts postings. You'll be surprised how many scripts there are already on this subject.

scripts 1
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html
scripts 2
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html

Cheers
Michael
Anyone for a Mutiny ?