Re: fstab has "user" option, but still cann't be mounted by non-root user
On Thu, 8 Sep 2011 14:48:08 +0000 (UTC)
debian-user-digest-request@lists.debian.org wrote:
> page of fstab,I set the "user" option,but still get error " mount:
> only root can do that" when i try to mount it.
>
>
> # /etc/fstab: static file system information.
> #
> # <file system> <mount point> <type> <options> <dump> <pass>
> # /dev/sdb4 none ext4 sw 0 0
> UUID=3De2f1534d-aecd-4f2a-a153-822ac4d73967 /media/usbdisk4_data
> ext4 user,exec,dev,suid,rw,noauto 0 0
I think you need to set up a mount point for your regular user, rather
than directly mounting the device in the /dev directory (. On my
machine, I have a two mount points for usb devices, since I have two
usb ports that I can use, and sometimes need to mount them
simultaneously. These are set up in the /media directory (/media/usb
and /media/usb2). My mount points are executable by all and can be
read by the user ("xr-x"):
mark@debian:/media$ ls -l
total 24
drwxr-x--- 2 root root 4096 Mar 5 2011 apt
lrwxrwxrwx 1 root root 6 Jul 23 2006 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 Jul 23 2006 cdrom0
lrwxrwxrwx 1 root root 7 Jul 23 2006 floppy -> floppy0
drwxr-xr-x 2 root root 4096 Jul 23 2006 floppy0
drwxr-xr-x 2 root root 4096 Jan 30 2011 hdb
drwxr-xr-x 2 root root 4096 Oct 17 2009 usb
drwxr-xr-x 2 root root 4096 Oct 17 2009 usb2
mark@debian:/media$
My fstab looks like this:
/dev/sdc1 /media/usb vfat noauto,user
0 0 /dev/sdd1 /media/usb2 vfat
noauto,user 0 0
However, I'm not sure if this is correct, given that UUIDs with various
incomprehensible numbers/letters seem to be used now (my fstab also has
these). But, I can usually mount my usb sticks, so something is
working. Anyway, I feel that creating an actual mount point, rather
than listing "none", might help. Check the /media file to see if there
already is a mount point that you can use (IE, /media/usb). If so,
replace the "none" in your fstab with the mount point. If not, then
create a mount point, and subsequently add this to your fstab.
Mark
Reply to: