LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-20-2005, 05:34 PM   #1
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Rep: Reputation: 30
mount drives at startup


I am wanting to have network resources available for all users (not root). I know how to mount them with the mount command, and also have aliases to mount certain drives.


How can I configure linux to mount these drives when a used logs on (or whenever...machine startup...whatever)? I am sure that there is some file that I can put the mount commands in, that is only accessible as root. Right?
 
Old 05-20-2005, 06:35 PM   #2
lordashraf
LQ Newbie
 
Registered: May 2005
Location: Alexandria , Egypt
Posts: 24

Rep: Reputation: 15
well, if you r talking about mounting other "WINDOWS" drives, then I hope wt i'm going to say would b any help to you, but i've read something in a little book about that... i used it to mount the C: drive on windows....

# 1st, make a directory to mount into, as u may know, for example (a directory called WINDOWS)

mkdir /mnt/ windows

# then type this..

gedit /etc/fstab
#inside the "fstab" file, change "dev/hda1" with
/dev/hda1 /mnt/windows vfat auto,umask=0 0 0

i think that if u don't c "dev/hda1" in fstab, then may b u have to mount it 1st.
 
Old 05-20-2005, 08:45 PM   #3
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
What you could do is add a command to the user's ~/.profile that is only read-writable by root but can be executed by group or global (chmod 711.) Then in the shell script that gets ran, have it mount the drives/shares needed.

Also, to avoid arbitrary running of this script by anyone, you could make it only group executable (chmod 710) and put the authorized users in that group.

OR

Have the script call out 'who' and match the results against an access list of people allowed to run it.

Let me know if this helps you or just confuses you more.
 
Old 07-26-2005, 01:39 PM   #4
MrLizard
LQ Newbie
 
Registered: Mar 2005
Location: glasgow
Distribution: ubuntu hoary (5.04) on acer travelmate 8103 & Custom desktop
Posts: 23

Rep: Reputation: 15
bash profile edit

Hi unreal128,

I think you might be able to help me out with something simliar:

I have an SATA drive with 5 partitions which i would like to be able to mount automatically at start-up.

Unfortunately, I cannot seem to make it work in the usual way through the fstab 'auto' option. I believe this is something to do with the order in which grub looks at things, but i have absolutely no idea if i'm being totally honest.

What i can do perfectly easily, however, is mount each partition by hand at the command line. This, of couse, is a total pain in the butt for more than 1 partition, especially considering that i want to be able to hit the power button on the pc and not have to have any further interaction with the computer, other than accessing files stored on the SATA disk via a samba network.

can you give me any advice as to how to edit my start-up profile so that the simple commands 'mount /dev/sda*' (* = 1,5,6,8 or 9) are executed (as root) when i log in ?

Thanks for any help you can give me.
 
Old 07-26-2005, 03:43 PM   #5
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
Check /etc/fstab and post it in your reply. I am thinking that most likely the SATA mountpoints are not in the file. 'fstab' gets automatically called upon runlevel/bootup, so it should mount whatever is in this /etc/fstab file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting Hard drives at startup Marvel Fedora 4 11-29-2004 03:30 AM
How To Mount The Windows Drives In Linux at Startup KnowledgeSeeker Linux - Software 2 09-24-2004 06:13 PM
Give user permission to mount/use cdrom drives or usb drives zwyrbla Linux - Newbie 2 08-23-2004 04:30 PM
mandrake 9.2 detecting new cdrom drives at startup lynnsbomb Mandriva 5 01-27-2004 08:21 PM
Auto-mounting drives at startup MandrakeDave Linux - General 7 09-29-2003 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration