1832978 Members
3049 Online
110048 Solutions
New Discussion

Re: how to mount CDROM!

 
SOLVED
Go to solution
leyearn
Regular Advisor

how to mount CDROM!

now i often have to mount CDROM
#mount /dev/dsk/c1t2d0 /cdrom
can i mount the cdrom just executing
"#mount /cdrom"
someone tell me to add an entry to /etc/fstab!
i don't want to mount CDROM automatically
when the system boot
which option should be specified in the entry?
9 REPLIES 9
Sridhar Bhaskarla
Honored Contributor

Re: how to mount CDROM!

Hi,

If you add /cdrom into /etc/fstab, then it will try to mount /cdrom while the system is booting.

If remembering|getting the device file c1t2d0 is a problem, then add it to the fstab but comment it out. So, when you want to mount /cdrom, you can 'grep cdrom /etc/fstab' and then use the full mount command.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Patrick Wallek
Honored Contributor
Solution

Re: how to mount CDROM!

Hmmm....Not often I can correct a fellow Olympian.....(No offense intended Sridhar)...

You can add an entry to the /etc/fstab file, BUT also have the CD NOT mount automatically. The key is an fstab option called "noauto".

This is from the esteemed Bill Hassell's answer in the following thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=218489


... you can simplify mounting in the future by adding a correct entry in /etc/fstab like this:

/dev/dsk/c0t2d0 /cdrom cdfs noauto 0 0

The noauto option is not documented but has worked in HP-UX since the early-90's. It disables the auto-mount for the CD at bootup. You can mount and un-mount the CD by just specifying the /cdrom mountpoint. fstab takes care of the rest.



I have GOT to remember to actually implement this on all of my HP-UX machines. It will definitely make life easier when mounting/unmounting CDs.
Shaikh Imran
Honored Contributor

Re: how to mount CDROM!

Hi,
The very Important thig is for putting the mount path in /etc/fstab u always need to have a cd in the CD-Rom Drive (i suppose).

I will tell u a simple script :
say your device file for CD is /dev/dsk/c1t2d0
#mkdir /cdrom
#cd /usr/bin
#vi cdmount ( Then enter the following)
mount /dev/dsk/c1t2d0 /cdrom
(save this file and come out of vi)
#chmod 777 cdmount

mow u only have to say cdmount to mount your cdrom drive

For Umounting

#cd /usr/bin
#vi cdumount
umount /cdrom
#chmod 777 cdumount

Now you have to only say cdumount to unmount the cdrom drive.
Assuming that yoou know vi editor.

Regards,
Imran SHaikh


I'll sleep when i am dead.
Bill Hassell
Honored Contributor

Re: how to mount CDROM!

As Patrick said, the noauto option is very useful on multiple machines. Many times the CDROM device file is something different but mount is smart enough to use either the device file or the mountpoint, so all your machines mount the same way: mount /cdrom

One note about /cdrom and noauto in fstab. The make_tape_recovery program from Ignite/UX does not pay attention to the filesystem type (cdfs) or the noauto option, so if the CD is not mounted, you'll get an error exit code. Now the backup was actually performed but without a clean exit code, it is hard to code this for a cron job. My Ignite/UX cron job removes all cdfs entries temporarily and puts them back when the job is done.


Bill Hassell, sysadmin
Sridhar Bhaskarla
Honored Contributor

Re: how to mount CDROM!

Thanks a lot Patrick. Actually I did recall that I used noauto option in my faded experience and wanted to post the correction later. But I got swept away with the bridge call during which I responded to this question.

-Sri

PS: No points please.
You may be disappointed if you fail, but you are doomed if you don't try
Sorrel G. Jakins
Valued Contributor

Re: how to mount CDROM!

When a problem such as this comes back as often as it does, I hope somebody somewhere within HP notices.

Clearly there is work to do on the useablity side of mounting CDROMs.

sorrel
Dan Bolton
Frequent Advisor

Re: how to mount CDROM!

I thought the correct place to define the cdrom mount was in /etc/pfs_fstab not /etc/fstab. Is this no longer the recomended method?

Thnks,
Dan
...skid in sideways, chocolate in one hand, martini in the other, totally worn out and screaming, "WOO HOO what a ride!"
The Real MD
Valued Contributor

Re: how to mount CDROM!

What you can do is make a link called /dev/cdrom to whatever full correct /dev/dsk/c?t?d? device file name is then just execute
mount /dev/cdrom /cdrom unfortunately I cant remember the exact syntax but you use the mknod command to do it.

Regards

Martin.
Patrick Wallek
Honored Contributor

Re: how to mount CDROM!

You only need to specify /etc/pfs_tab if you are using the pfsmount commands. It is no longer recommended to use those. Instead you should patch mount with the latest patches so that it will now natively support the Rock Ridge format. The Rock Ridge format is why you used to have to use the pfs* commands.

With the appropriate patches, you can just specify 'mount -o rr,ro /dev/dsk/c?t?d0 /cdrom' to mount a Rock Ridge format CD.