Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-01-2003, 06:47 PM
|
#1
|
LQ Newbie
Registered: Jun 2003
Posts: 10
Rep:
|
problem creating an alias to mount a drive
I am running RH 8.0. Am trying to create a simple alias to allow me to mount my usb floppy drive (which is normally mountable, when I'm logged on as root, via "mount -t auto /dev/sda /mnt/usb/"). So I put an alias line in .bashrc as follows:
alias mountusb='mount -t auto /dev/sda /mnt/usb/'.
Once I log back on and type "mountusb" I get "Only root can do that." So when I log on as root and type in "mountusb" I get "command not found." How can I correct this?
Thanks.
Jared the 
|
|
|
07-01-2003, 07:39 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
It's less of an alias than an administrative
problem ...
What you want to do is to edit
/etc/fstab
and add something like
/dev/sda /mnt/usb noauto user,rw 0 0
After that you can add a line like your
alias to both roots and your normal users
.bashrc :}
Cheers,
Tink
|
|
|
07-01-2003, 07:41 PM
|
#3
|
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185
Rep:
|
and just to explain your problem, you are adding that alias to your normal users .bashrc, the root has this same file in the home (/root) directory also....so the reason why it said command not found is because what you added to your normal users .bashrc wasn't added to you roots .bashrc..
|
|
|
07-01-2003, 07:41 PM
|
#4
|
Member
Registered: Apr 2003
Location: Australia
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Rep:
|
Well yeah you could make an alias but then you would need to create an Sbit for the alias that root has created. i.e. chmod 4555 /bin/mount and make sure that the alias is in everyone's path. What would make more sense would be to edit the /etc/fstab:
/dev/sda mountpoint auto defaults,noauto,owner 0 0
then when you want to mount the drive:
$mount mountpoint
On another note, I believe that mount available to users if it is available in the fstab or they have permissions to the mount command.
It sounds like your getting command not found because you edited in /root/.bashrc instead of /home/user/.bashrc You could resolve this by editing the /etc/skel/.bashrc and creating the new accounts
|
|
|
07-01-2003, 10:24 PM
|
#5
|
LQ Newbie
Registered: Jun 2003
Posts: 10
Original Poster
Rep:
|
Thanks to all!
|
|
|
07-01-2003, 10:28 PM
|
#6
|
LQ Newbie
Registered: Jun 2003
Posts: 10
Original Poster
Rep:
|
Tinkster and KDE4me, if I edit fstab, will my changes still be **in** that file after I reboot the machine, or will I need to modify fstab each time I log on? I have modified fstab in other ways recently and it seems to me that my changes disappeared upon rebooting.
|
|
|
07-01-2003, 10:41 PM
|
#7
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
If they disappear RH displays some ODD
behaviour ...
Cheers,
Tink
|
|
|
All times are GMT -5. The time now is 04:03 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|