1752812 Members
5966 Online
108789 Solutions
New Discussion юеВ

mt_cd ???

 
Tarek
Super Advisor

mt_cd ???

Hi all,
a user asked me to install mt_cd command to some hpux workstation... i have never heard about it.. is it possible to install it?? i saw that there isn't any manual with this entry...
any tip??
Thanks in advance.
Tarek
16 REPLIES 16
Patrick Wallek
Honored Contributor

Re: mt_cd ???

That is not a valid HP-UX command. At least not that I know of.

Could they have an alias set up something like

alias mt_cd="mount /dev/dsk/c?t?d? /cdrom"
someone_4
Honored Contributor

Re: mt_cd ???

Hello,
But you cant mount a cd unless you have a user id of 0 wich is a superuser that is just as powerfull as root.
Wim Rombauts
Honored Contributor

Re: mt_cd ???

What is it that your user wants to do ?

If it is mounting a CD as the others suggest, you can configure the automounter to do that for you. The CD will be mounted when the user accesses the mountpoint and will be unmounted after a certain time of inactivity.
Tarek
Super Advisor

Re: mt_cd ???

I think that's it!!
Some users want to be able to mount and umount CD's whenever they want, so they don't have to call me each time to do that.
How can i configure this auomatically as suggested before with automounter??
Thanks
Tarek
Sanjay_6
Honored Contributor

Re: mt_cd ???

Hi tarek,

Create a file in /usr/bin with the mt_cd and have this entry in that file
mount -r /dev/dsk/c?t?d? /cdrom

Here c?t?d? is the device file name for the Cdrom as shown be "ioscan -fnC disk"

Change the permission of the file to 755. your users should now be able to use this command to mount the cdrom.

Hope this helps.

thanks

Tarek
Super Advisor

Re: mt_cd ???

Thanks Sanjay for your help, but unfortunately it isn't working. I created the file /usr/bin/mt_cd and i've set the permissions to 755, but while a user execute it, he will have this error:
mount: must be root to use mount
any further help?? Thanks very much.
Tarek
Ravi_8
Honored Contributor

Re: mt_cd ???

Hi, tarek
your user might have wanted a script to mount the cd instead of issuing command.
put the CD mounting command in a file and add in PATH.

never give up
Patrick Wallek
Honored Contributor

Re: mt_cd ???

You could also use sudo to do this.

Sudo allows non-root users to run commands, as set up by you, as root without knowing the root passwd.

You can get sudo here:
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/

Once that is done, you could set up the mt_cd script as something like:

sudo mount /dev/dsk/c?t?d0 /cdrom

The script and users would then need to be set up in the /etc/sudoers file and then when the user enters mt_cd, they will be prompted for their password and the cd will be mounted.

You should probably also set up a umt_cd script with something like:

sudo umount /cdrom

so that the user can also unmount the cd when they are finished.
someone_4
Honored Contributor

Re: mt_cd ???

Hi
here is a link where that talks about the same probem that you are having now.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xca1d8ffa98a2d5118ff10090279cd0f9,00.html