Operating System - HP-UX
1821625 Members
3265 Online
109633 Solutions
New Discussion юеВ

Re: mounting cd automatically

 
Pramod Sharma
Occasional Contributor

mounting cd automatically

hi all !

Is there any way to mount cdrom automatically in HP-ux?
or Is there any way to allow a non root user to mount cdrom ?


regards
do good, have good
6 REPLIES 6
Michael Tully
Honored Contributor

Re: mounting cd automatically

You can automatically load it from the system boot.
Just make sure that the entry for the device and the directory are part of /etc/fstab

e.g.

/dev/dsk/c2t1d0 /cdrom cdfs ro 0 2

If you wish another user other than root to mount it, your best bet is to load 'sudo' and allow them access to the mount command.

You can get sudo from here:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.6/

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
Anyone for a Mutiny ?
T G Manikandan
Honored Contributor

Re: mounting cd automatically

There is no way the cdrom's get mounted automatically as in Solaris where the volmgt takes care.

YOu need to manually mount them when you insert the CDROMs

You can also follow a alternative way of mounting them as suggested above but in that case too the CDROM should be inside the CD-drive.

You can install 'sudo' to provide access to mount CDROMS by normal users.


Thanks
V. V. Ravi Kumar_1
Respected Contributor

Re: mounting cd automatically

Hi,
add the entry in /etc/fstab like this

cdfs ro,rr 0 0

Ex:
/dev/dsk/c3t2d0 /cdrom cdfs ro,rr 0 0

Better not to allow any other user to mount CDROM. But still u can do it with SUDO.

Regards
Never Say No
RolandH
Honored Contributor

Re: mounting cd automatically

Yes you can do it with any extra programm.
Use the automounter.

1. Change in the file /etc/rc.config.d/nfsconf the paramters

AUTOFS=1
AUTOMOUNT=1
AUTO_MASTER="/etc/auto_master"
AUTO_OPTION="-f $AUTO_MASTER"
START_MOUNTD=1

(I've attached the file)

2. Create/edit your file /etc/auto_master and add line:

/mount /etc/auto.cdrom

3. Create a file /etc/auto.cdrom and add line

cdrom -fstype=cdfs,ro :
i.e your cdrom device file is c2t3d0
then your line looks like this

cdrom -fstype=cdfs,ro :/dev/dsk/c2t3d0

4. Create a directory /mount
mkdir /mount

5. Start the nfs client

/sbin/init.d/nfs.client start

6. Change in the directory

cd /mount/cdrom


And now the automounter will mount the cdrom to this dir and you can see its content. It is accesible from the user, too. No need to mount manually with super-user privileges if a user needs the cdrom.

Regards
Roland

Feel free to assign points.

To all others - read the man page from automount(1m)
Sometimes you lose and sometimes the others win
Zeev Schultz
Honored Contributor

Re: mounting cd automatically

In addition to Roland's fine solution:
pay attention that you don't have patch
phkl_26239 installed as it has issues with
automount and non-NFS mounts.phkl_28999 fixes.
And of course give points to those well deserving :)
So computers don't think yet. At least not chess computers. - Seymour Cray
RolandH
Honored Contributor

Re: mounting cd automatically

A little typo in my first answer.

You can do it WITHOUT any extra programm.

But what I forgot to mention the automountd hold the mount (default) for 5 minutes, if the mount is not used. Foremost then it unmounts the cdrom.

So, if you have a user, who often changes the cdrom you must set your duration to a lower value. You can to this if you set the parameter to:

AUTO_OPTIONS="-f $AUTO_MASTER -t 10"

Then the automountd will unmount the cdrom after 10 seconds it was not used.


Regards
Roland


Feel free to assign points
Sometimes you lose and sometimes the others win