System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

how to distinguish dvd rom or hard disk

alert0919
Advisor

how to distinguish dvd rom or hard disk

how could I determine which is disk or dvd-rom
because i use command
ioscan -fnC disk
I found dvd rom and hard disk ,I only would like to show hard disk only,how to do it
how to distinguish them

I need to use program to distinguish them
my attached file which shows my machine result

thanks
15 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: how to distinguish dvd rom or hard disk

hi,

the first, there is a comment DVD-ROM

device file : /dev/dsk/c0t0d0

HW path : 0/0/2/0.0.0.0

mikap
Steven E. Protter
Exalted Contributor

Re: how to distinguish dvd rom or hard disk

Shalom,

Right hand column.

Where it says: DVD-ROM

ioscan -fnC disk | grep -v -i dvd-rom

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Torsten.
Acclaimed Contributor

Re: how to distinguish dvd rom or hard disk

it's very obvious what the DVD is, but because it is a disk too, all 3 are listed in your ioscan.

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: how to distinguish dvd rom or hard disk

ioscan cannot distiguish between different types of disks (ie, CD, DVD, arrays, solid-state, optical RW, etc). At the end of the line, it reports what a SCSI ID request returns from the device. Thus, there is no guarantee what the result will be. Some disks report their product number (ie, Seagate), others report the manufacturer (TEAC, HP, EMC, etc). So there is no generalized way to identify the different types of disks.


Bill Hassell, sysadmin
Vishu
Trusted Contributor

Re: how to distinguish dvd rom or hard disk

Hi,

I agree with Bill that ioscan does not diffentiate between different types of disks. so, in your case, the only way to get only Hard disk is to use the grep.

# ioscan -fnC disk | grep -v -i dvd-rom

This will give you what you required.
alert0919
Advisor

Re: how to distinguish dvd rom or hard disk

I try this command ioscan -fnC disk | grep -v -i dvd-rom
it cannot solve my problem

the dvd rom still exist
in my attached file,it shows this situation

R.K. #
Honored Contributor

Re: how to distinguish dvd rom or hard disk

Hi,

You are getting this o/p as option "-v" is "All lines but those matching are printed"....so the line containing "DVD" is removed but the entry for DVD contains two lines and only One line containing DVD is removed and what you are seeing is the other line.

Regds,
R.K.
Don't fix what ain't broke
Sivakumar MJ._1
Respected Contributor

Re: how to distinguish dvd rom or hard disk

Hi Alert0919,

Go thru this book page number from 135 - 140.. you will get a clear picture..
For HP Online Case Logging-->http://support.openview.hp.com/
Sivakumar MJ._1
Respected Contributor

Re: how to distinguish dvd rom or hard disk

Hi Alert0919,

Go thru this book page number from 135 - 140.. you will get a clear picture..

http://books.google.com/books?id=Ni3G00IKHh4C&pg=PA138&lpg=PA138&dq=ioscan+output&source=bl&ots=P7ptHXsQwu&sig=dMDhMB_96GQzFD797lnnpUhEXEg&hl=en&ei=ljhUSum6EIy5jAflgomhCQ&sa=X&oi=book_result&ct=result&resnum=6
For HP Online Case Logging-->http://support.openview.hp.com/
Torsten.
Acclaimed Contributor

Re: how to distinguish dvd rom or hard disk

What do you really want to get?

The DVD or all disks without the DVD?

SAM -> disks will sort this for you, try this.

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: how to distinguish dvd rom or hard disk

> bash-4.0#

This looks like bash is root's shell (# prompt is typically only for root). If this is root's shell in /etc/passwd, you cannot run in single user mode (a very bad thing). bash does not come in an archived library version unless you compile and make one. In single user mode, /usr is not mounted so bash doesn't exist. Only the programs in /sbin will be seen.

And don't copy bash to /sbin because it will required shared libraries found in /usr/lib...still leaving root without any shell in single user mode.

The correct (only) shell for root is /sbin/sh which is not the Bourne shell but the POSIX shell, virtually the same at the command level to bash and ksh. Most notable differences involve interactive features such as arrow keys and command history manipulation.

> ioscan -fnC disk

Add the -k option so ioscan will run about 100 times faster.


Bill Hassell, sysadmin
Vishu
Trusted Contributor

Re: how to distinguish dvd rom or hard disk

Hi alert0919,

please try this command to get only the disk in your system.

# ioscan -C disk | grep -i -v dvd-rom

It will show all the hard disk only. the logical path to the DVD-ROM, which you see on your last output will be gone this time hopefully. Please try and paste the output.

Thanks
Vishu
Trusted Contributor

Re: how to distinguish dvd rom or hard disk

Hi,

Assigning points is also a way to say Thank you to people who are spending their valuable time in resolving your issues. so, plz assign points to them.

Thanks
alert0919
Advisor

Re: how to distinguish dvd rom or hard disk

Hi, all responser
thanks for your replies
I have solved my question by using command diskinfo
when it is a disk
When i use diskinfo /dsk/rdsk/c0t0d0
it will shows type:direct access
if it is a CD-ROM
When i use diskinfo /dsk/rdsk/c0t0d0
it will shows type:CD-ROM
so I could distingisush them

alert0919
Advisor

Re: how to distinguish dvd rom or hard disk

thanks for all replies