PDA

View Full Version : FC3, the LVM and CDROM


zjimward
25th September 2004, 01:32 AM
Okay, all these years if I wanted to mount my cdrom from cli, I typed:

mount cdrom

Now to mount my cd I have to type:

mount /media/dvdrom

How can I configure my system so I can type:

mount dvdrom

Thanks.

superbnerd
25th September 2004, 01:56 AM
Here is a close solution:

Try creating a variable in your ~/.bash_profile
Note: ~ is a variable for your home directory

make it look something like this # .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

dvdrom= /media/dvdrom

PATH=$PATH:$HOME/bin:/sbin:/usr/sbin:/usr/local/sbin

export PATH dvdrom
unset USERNAME Then logout and back in and test it. the only thing is you will have to use mount $dvdrom You may be able to use alias command to get rid of having to use the "$"
I hope that's close to what you're looking for.

zjimward
25th September 2004, 04:57 PM

Yes, I considered that or a .bashrc function to handle the same thing. I figured that it would be better to configure 'mount' instead of creating an alias or function. Thanks for the suggestions.

superbnerd
26th September 2004, 04:17 AM
how does one go about configuring mount to use aliases? please post you results and how you did it.

zjimward
26th September 2004, 03:42 PM
As far as I know you can't make an alias that can be passed to mount like an environment variable. You can do the following with alias:

alias mdvdrom='mount /media/dvdrom'
alias udvdrom='umount /media/dvdrom'

In this way you could type:

mdvdrom

To mount the dvdrom and type:

udvdrom

When you want to dismount the dvdrom. I'm not so sure there's a lot of time savings in typing either of these commands. I don't really use the mount cdrom much and in fact have noticed that it doesn't work under FC2 any more either. It's just old habits die hard some times and I got use to typing it, when I needed. Hope that answers your question. I know that if you type:

eject cdrom

That ejects the cdrom tray and:

eject -t cdrom

Retracts the cdrom tray, so some how it knows the mount point for the drive and mount doesn't.