LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-28-2005, 06:01 PM   #1
aze
Member
 
Registered: Dec 2002
Location: Brazil
Posts: 31

Rep: Reputation: 15
3 mount questions


hey!

well, i have all my disc units and partitions set at /etc/fstab as i wish.
but i have 3 questions:

1) every time i start the system i have new mount point: /mnt/idedisk to an FAT partition which i DONT want to mount. how can i disable this "automount" feature? (i already removed the entry from fstab but when i restarts its back there

2) what should i put into umask parameter on fstab to users get full access for all mounted fat32 units?

3) how do i give user permissions to mount/umount units?

this is my /etc/fstab:

Code:
/dev/hda10       swap             swap        defaults         0   0
/dev/hda9        /                ext3        defaults         1   1
/dev/hda11       /home            ext3        defaults         1   2
/dev/hda12	 /mnt/slax	  ext3	      defaults	       0   0
/dev/hda1        /mnt/win_c       vfat        user,rw,umask=000,auto,exec         0   0
/dev/hda5        /mnt/win_d       vfat        user,rw,umask=000,auto,exec         0   0
/dev/hda6        /mnt/win_e       vfat        user,rw,umask=000,auto,exec         0   0
/dev/hda7        /mnt/win_f       vfat        user,rw,umask=000,auto,exec         0   0
/dev/hdc         /mnt/dvd         iso9660     auto,user,ro  0   0
/dev/hdd         /mnt/cdrw        iso9660     auto,user,rw  0   0
/dev/fd0         /mnt/floppy      vfat        user,noauto     0   0
/dev/sda1        /mnt/flash       vfat        user,rw,umask=000,auto,exec         0   0
/dev/sda1        /mnt/mp3player    vfat        user,rw,umask=000,auto,fat=16,sync  0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
none		/sys		sysfs		defaults	0   0
/dev/hda8               /mnt/idedisk1           vfat    noauto,user,exec 0 0 # <-this line must die!
running slackware 10 kernel 2.6.10
 
Old 01-28-2005, 07:26 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
1) log in as root and just delete that line with an editor of choice?
if your unsure how to use the editor then i don't understand why
you cannot delete it ..

2 & 3)
Code:
/dev/hdg1        /mnt/80gig       vfat        user,rw,umask=000         1   0
thats an example of a drive i have.
that gives normal and of course root full access to the drive
to write, read, mount, etc ...
 
Old 01-28-2005, 08:55 PM   #3
winsnomore
Member
 
Registered: May 2004
Location: USA
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315

Rep: Reputation: 31
put the word "noauto" before the word "user" in the line for the drive in fstab.
Now you can mount it as user and the system won't automount it on boot.
 
Old 01-29-2005, 05:23 AM   #4
aze
Member
 
Registered: Dec 2002
Location: Brazil
Posts: 31

Original Poster
Rep: Reputation: 15
thanks for answers guys.


/dev/sda1 /mnt/flash vfat user,rw,umask=000,auto,exec 0 0

this line is for an usb flash disk.
Even if it is not pluggeed on boot time i can't mount it as user.

Code:
mount: only root can do that
 
Old 01-29-2005, 02:18 PM   #5
winsnomore
Member
 
Registered: May 2004
Location: USA
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315

Rep: Reputation: 31
Only thing I see quiet strange is that you have /dev/sd1 listed to be mounted at 2 different places.
so what are you tying when you want to mount

typing mount /dev/sd1 would be confusing for mount and might barf (or mount the first entry I am not sure)
For testing the mount .. comment out the second line with /dev/sd1

you can try a few tings .. try
mount -a (should mount all auto maked devices)
check out what file system this flash device is .. are you sure it's Vfat ?
put it as auto in the fstab and see if that works.
it's a good idea to leave it as auto rather than a specific filesystem, unless it's a fixed device .

checkout the manpage an on mount
 
Old 01-29-2005, 03:05 PM   #6
aze
Member
 
Registered: Dec 2002
Location: Brazil
Posts: 31

Original Poster
Rep: Reputation: 15
thanks!

but the main problem is:
users cant mount.
 
Old 01-29-2005, 04:08 PM   #7
mparkhurst
LQ Newbie
 
Registered: Jan 2005
Posts: 4

Rep: Reputation: 0
Only root can mount drives, even if you can set permissions for users to use those drives after they are mounted.

If you want to allow users to mount drives, they have to do it as root--sudo is the best way.

Code:
root@whatever# visudo
Vi will come up with the sudoers file. edit the file in the following manner:

Code:
john ALL=(root) mount
"john" is the username, "ALL" is the computer (You can use the computer, or ALL. ALL is used for all computers on a network) "(root)" is the username the command is executed as. "mount" is the command executed.

This means: John is allowed to execute the command "mount" as the user root, on all computer on the network.

If you want john to be able to use umount also, you would add this:

Code:
john ALL=(root) mount,umount
Add any commands to that line just by adding comma, use can also use ! to say "not this command" like:

Code:
john ALL=(root) ALL,!su,!/bin/sh
So john can run anything as root, except su, and sh. (Although he could probably run bash as root...)

to use the commands and execute them as root:

Code:
john@whatever# sudo mount -t whatever /dev/whatever /mnt/whatever
john@whatever#
--Michelle
 
Old 01-29-2005, 04:27 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
To add to the /etc/sudoers information, just look at the end of the file:
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now

If you uncomment the second to the last line, this will give users the ability to use the mount and umount command when working with the cdrom.

You may want to read through the 'info sudoers' pages. You can set whether someone authenticates with there own password or the root password. The latter is better because then only one person needs the root password.
 
Old 01-29-2005, 04:33 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
To add to the /etc/sudoers information, just look at the end of the file:
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now

If you uncomment the second to the last line, this will give users the ability to use the mount and umount command when working with the cdrom.

You may want to read through the 'info sudoers' pages. You can set whether someone authenticates with there own password or the root password. The latter is better because then only one person needs the root password.

Another thing, on systems with more than one administrator, sudo can also help by logging who used sudo and when.
This can help if someone made changes that you need to track down. i.e. , you know who to ask.
 
  


Reply



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
Questions about what 'mount' does Mr Smokin Joe Linux - Newbie 15 03-27-2005 07:47 PM
How to mount cdrom? And another questions hemmelig Linux - Software 5 12-15-2004 03:50 AM
mount questions 1racerx Linux - Newbie 4 10-05-2004 07:09 AM
HD Mount and Partition Questions grcbheax Linux - Newbie 1 08-11-2004 09:05 AM
mount questions ..... purpleburple Linux - General 7 08-07-2002 09:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:43 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