LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 09-06-2006, 12:55 PM   #1
JacekZ
Member
 
Registered: Sep 2005
Location: Notts, England
Distribution: Debian 6
Posts: 69

Rep: Reputation: 15
Confused about mount command


To mount a drive I have to do it as root. Then I can write to the drive as root. It seems according to the man page that I should be able to mount it with a 'users' option so that I can later mount it as a regular user, but it seems to me there should be a way to mount a drive (presumably as root) in such a way that other users (i.e. me as a regular user and not root) can use it without having to mount it themselves, after all I regularly use various mount points without mounting anything at all. What am I misunderstanding in this scheme of things please?
 
Old 09-06-2006, 01:04 PM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
take a look at /etc/fstab. that's a file which as all the information about which drives are mounted. to mount a drive automatically at boot time depends on what file system is has, whether you want all users to have the ability to mount it etc.

to allow non-priviledged users to mount these other drives, you need to add an entry into fstab with the option users added. something along these lines would probably work:
Code:
/dev/hdX1    /mnt/some_folder    vfat    auto,users     0  0
where hdX1 is some partition of yours, and /mnt/some_folder is a folder you want to mount the drive to. the vfat bit refers to the filesystem (in this case fat, but it could be ext3, reiserfs, ntfs (be careful with ntfs - add ro to the column with users in it) etc.). The auto bit would mount it automatically at boot (as opposed to noauto which doesn't) and the users bit allows non-root users to mount it. Hope this helps.

Last edited by pwc101; 09-06-2006 at 01:06 PM.
 
Old 09-06-2006, 01:06 PM   #3
olaola
Member
 
Registered: Aug 2006
Location: Italy
Distribution: Fedora
Posts: 41

Rep: Reputation: 15
editing the /etc/fstab file, root can decide who can mount, unmount, ad write to a device or partition, taking into account also the folders permission
 
Old 09-06-2006, 05:41 PM   #4
JacekZ
Member
 
Registered: Sep 2005
Location: Notts, England
Distribution: Debian 6
Posts: 69

Original Poster
Rep: Reputation: 15
how to set mount.cifs to setuid root?

Thanks pwc101 and olaola, I was afraid that might be the answer as I didn't want to edit the fstab file unless I had to. It works for a floppy and for a second hard drive, but for a network attached storage I am using a cifs call. This has to be run by root. Apparently you can "set the mode for mount.cifs to setuid root to allow non-root users to mount shares to directories for which they have write permission", but I can't find anywhere how to do that. Any ideas?
 
Old 09-08-2006, 04:10 AM   #5
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
sorry, I'm all out hope you get your answer
 
  


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
Mount Command help randy1970 Linux - Newbie 2 04-25-2006 05:32 PM
Mount Command vishalfirke Linux - Newbie 3 01-28-2005 10:34 AM
About mount command A-Liang Programming 1 11-18-2004 07:26 AM
Mount command emperor13 Linux - General 3 11-25-2001 02:06 PM
mount command loganwva Linux - Networking 3 09-19-2001 02:27 PM

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

All times are GMT -5. The time now is 05:47 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration