Granting users permission to mount drives in Linux.

zoiks

Lifer
Jan 13, 2000
11,787
3
81
Hello folks, Ive been using redhat and mandrake for a while now but i still dont know how to give any particular user permissions to mount a drive in linux.
The deal is that i would like to setup a script that would mount the ntfs drives on startup. somehow when i try to put in an entry for a ntfs mount in /etc/fstab, i get an error. However i am able to mount them on my own by simply using "mount -t ntfs /dev/win_j /xtc13/ntfs1" or something similar.
Now the mounts by default are only done by root but i would like a regular user to be able to mount their own drives by running their own scripts on startup.
I know it can be done but somehow despite all my research, the answer still eludes me.
Thanks in advance much.
zoiks
 

hobgadling

Member
Oct 23, 2001
39
0
0
You have to become root and edit /etc/fstab. At the ends of the lines, there are some options (for cdroms, you'll see things like fs=...,dev=...). add user, or if it says nouser, change it to user.

HTH.

-Hob
 

zoiks

Lifer
Jan 13, 2000
11,787
3
81
Thanks for the reply, i guess i just need a little more prodding in the right direction
This is my fstab file.

/dev/hdb5 / reiserfs notail 1 1
none /dev/pts devpts mode=0620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdc /mnt/cdrom auto user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0
/dev/scd0 /mnt/cdrom2 auto user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-1,umask=0,sync,exec,codepage=850,noauto 0 0
/dev/hda1 /mnt/win_c vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
/dev/hda6 /mnt/win_d vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
/dev/hda9 /mnt/win_e vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
/dev/hdb6 /mnt/win_e2 vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
/dev/hdb7 /mnt/win_f vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
/dev/hdb8 /mnt/win_g vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
/dev/hdb10 /mnt/win_h vfat iocharset=iso8859-1,umask=0,codepage=850 0 0
none /proc proc defaults 0 0
/dev/hdb1 swap swap defaults 0 0

Above /dev/hdc defines the cdrom which has the user example you mentioned. How would you do this for a particular partition lets say hdb5 for example.
Thanks again.
 

hobgadling

Member
Oct 23, 2001
39
0
0


<< /dev/hdb5 / reiserfs notail 1 1 >>


/dev/hdb5 / reiserfs notail,user 1 1
But you shouldn't be doing that with /. :)

-Hob