- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- [ What is the best way to find whether CD is prese...
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
03-13-2005 08:54 PM
03-13-2005 08:54 PM
[ What is the best way to find whether CD is present in CD ROM or no ]
What is the best way to find that cd is existing in the cdrom. Assume that i have not mouted any cd. But just put cd in to the cdrom.
Also, is it that all the time cd will be reocgniged by c0t0d0 in /dev/dsk ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 08:57 PM
03-13-2005 08:57 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
If it's c0t0d0 now, it will always be c0t0d0 unless you change it. If you mena that on all systems it's c0t0d0, the answer is no.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 09:06 PM
03-13-2005 09:06 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
i can only think of mount command.
to check which device file the CD-ROM belongs:
# ioscan -funC disk
look for CD-ROM under description column and the device file u may use to mount and check if any CD exists
# mount /dev/dsk/c#t#d# /CDROM
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 09:17 PM
03-13-2005 09:17 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 09:36 PM
03-13-2005 09:36 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
Eric Antunes : I hope there is no eject command in HPUX. (if there ) How program will find that cd is present in CDROM by ejecting the CD ? If CD is mounted then we can simply grep for mount target in mount out put. And under DEVICE column i am not getting CD-ROM or any related words.
So i have following doubrs with the solutions got from you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 09:43 PM
03-13-2005 09:43 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
I think you didn't undrestood my point of view:
- you can only eject the cd if it isn't mounted;
- you can only mount the CD drive if there ia a valid CD in it and the drive is ok. To check if the drive is ok:
#ioscan -fnCdisk
Please post the ioscan results here...
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 09:46 PM
03-13-2005 09:46 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
# ioscan -fnkCdisk
disk 0 0/0/1/0.1.0 sdisk CLAIMED DEVICE HP DVD-ROM 304
/dev/dsk/c0t1d0 /dev/rdsk/c0t1d0
disk 1 0/0/1/1.2.0 sdisk CLAIMED DEVICE SEAGATE ST39103LC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 2 0/0/2/0.2.0 sdisk CLAIMED DEVICE SEAGATE ST39103LC
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
In my case the dvd/cdrom is c0t1d0
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 11:01 PM
03-13-2005 11:01 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
fstyp /dev/dsk/c3t2d0
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2005 11:31 PM
03-13-2005 11:31 PM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2005 12:26 AM
03-14-2005 12:26 AM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
The command:
ioscan -knfC disk
is the fastest way to determine where the CD drive is located, but you'll notice that all disks (not just CD drives) are listed. There is no way to filter ioscan beyond the disk class. The CD drive may be a DVD or CD-RM but this is dependent on the response from the CD itself. ioscan uses the SCSI ID command to determine the description. Note you can safely assume that the device file will be different on every machine. Many sysadmins will setup new machines by creating a /dev/rdsk/cdrom and /dev/dsk/cdrom devicefile so that they are easily identified.
However, the diskinfo command will work and it has the benefit of the "type:" field which reports "direct access" for disks and CD-ROM for CD drives. diskinfo will be immediate or take as much as 5-10 seconds to complete depending on HP-UX revision and patches.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2005 12:40 AM
03-14-2005 12:40 AM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
I've not tested it,
but the following might work...
#!/bin/ksh
diskinfo /dev/dsk/cdrom
if [ $? -ne 0 ]
then
echo "Error No Disk in Drive"
exit 1
fi
# Continue on as if disk is in drive...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 04:02 AM
03-15-2005 04:02 AM
Re: [ What is the best way to find whether CD is present in CD ROM or no ]
Here's a small script that will find the device file for the cdrom, and mount or unmount it.
Regards,
Mark