LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   3 mount questions (https://www.linuxquestions.org/questions/linux-software-2/3-mount-questions-283509/)

aze 01-28-2005 06:01 PM

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

DrOzz 01-28-2005 07:26 PM

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 ...

winsnomore 01-28-2005 08:55 PM

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.

aze 01-29-2005 05:23 AM

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
:(

winsnomore 01-29-2005 02:18 PM

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

aze 01-29-2005 03:05 PM

thanks!

but the main problem is:
users cant mount.

mparkhurst 01-29-2005 04:08 PM

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

jschiwal 01-29-2005 04:27 PM

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.

jschiwal 01-29-2005 04:33 PM

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.


All times are GMT -5. The time now is 03:00 PM.