# mount usb as normal user

## ad_meis

Hi all,

I have been searching the forums for a solution, but couldn t solve my problem.

I cannot mount my usb flash as normal user (I can as root). Here is the fstab entry for the usb

/dev/sdb1               /mnt/usb1      vfat            noauto,users,exec,sync     0 0

(I tried some small changes as vfat/auto and user/users)

The user is in usb group.

When I type

>mount /mnt/usb1  (or /dev/sdb1)

I get

[mntent]: line 22 in /etc/fstab is bad (it is the line I pasted above)

mount: can't find /mnt/usb1 in /etc/fstab or /etc/mtab

When I try 

>mount /dev/sdb1 /mnt/usb1

I get

mount: only root can do that

I am quite lost. The only thing I suspect is that it could be a matter of privilege to mount, even though I tried (unsuccesfully) the following

>chmod +s /bin/mount

I hope somebody can help,

marco

----------

## GaDDiM

I use ivman as configured as in HOWTO ivman, it automatically mounts the usb devices in /media with read and write options for me and no one else +  I can umount it via pumount.

it has some outdated info and current info in it.

Read it properly and you should solve your problem.

And don't forget to remove the /dev/sdb1 entry in your fstab if you going to use ivman >= 6.0 with pmount (you probably will)

----------

## ad_meis

Thanks a lot for the suggestion  :Cool:  .

I ll do that if I cannot solve the problem.

The thing is, I d really like to figure out what is wrong with my settings  :Exclamation: 

Any hints is welcomed, I m lost   :Rolling Eyes: 

Marco

----------

## CptPajamas

I'm having the same problem mounting USB sticks are a normal user. I get the same exact errors, and have "users" in fstab, and the user in the "usb" group.

So, *BUMP*

----------

## poolfool

Well, just as an idea but are you using Udev ? What does your Udev rule look like? I would guess that /dev/sd?1 is owned and operated by root:root with 770 permissions. Try ls -al /dev/sb?1 with the USB stick in and post the results.

If I am write ... a quick google on Udev rules, or just add GROUP="usb" to the offending rule.

----------

## zhooded

```
$ mount /mnt/usb1

mount: can't find /mnt/usb1 in /etc/fstab or /etc/mtab
```

Mount doesn't know where you want to mount it. After device you must add destiny directory

```
$ mount /dev/sdb1 /mnt/usb1 

mount: only root can do that
```

Yes, only root can do it. The solution is:

```
# emerge sudo

$ sudo mount /dev/sdb1 /mnt/usb1 

```

Edit /etc/sudores to let users to run certain programs without password. I have it improved all this adding in my .bashrc:

```
$ cat ~/.bashrc

...

alias mountUSB="sudo mount /dev/sdb1 /mnt/usb1";echo "mounting USB for you..."

$ mountUSB

mounting USB for you...
```

alias substitutes its expression in bash; very confortable

----------

## GaDDiM

 *zhooded wrote:*   

> 
> 
> ```
> $ mount /mnt/usb1
> 
> ...

 

That is why he put it in /etc/fstab, you only have to specify the source or destination if you have it in /etc/fstab

----------

## format_c

 *ad_meis wrote:*   

> Hi all,
> 
> ...
> 
> /dev/sdb1               /mnt/usb1      vfat            noauto,users,exec,sync     0 0
> ...

 

The option you have to set is user instead of users. Then you CAN mount it as normal user using 

```

mount /mnt/usb1

```

You do not need the exec-option for usb devices

The disadvantage of ivman is, that all devices will be mounted without the sync option. That is very problematic with usb storage devices.

If the dev-name isn't correct (I remember my usb stick at /dev/sdb) you can check when you replug the stick and check with dmesg which device was recently added.

Greets Alex

----------

## fangorn

I use udev rules for all my usb sticks that creat the device /dev/usbstick, so all good a dozen usb sticks in my buro are mountable with just one entry in the fstab.

----------

## ad_meis

 *poolfool wrote:*   

> Well, just as an idea but are you using Udev ? What does your Udev rule look like? I would guess that /dev/sd?1 is owned and operated by root:root with 770 permissions. Try ls -al /dev/sb?1 with the USB stick in and post the results.
> 
> If I am write ... a quick google on Udev rules, or just add GROUP="usb" to the offending rule.

 

Well this is the result. The user is in the usb group.

ls -la /dev/sdb1          

brw-rw---- 1 root disk 8, 17 Aug  9 12:47 /dev/sdb1

I did some googling, and tried this fstab line

/dev/sdb1               /mnt/usb1       auto            noauto,user,rw  0 0

Now IT IS WORKING. THANKS EVERYBODY   :Laughing: 

----------

## erik258

I am having the very same problem, but editing my fstab did not help.  I am wondering whether this is a UDEV permissions problem, or possibly with PAM (i vaugely remember modifying some files, I thought) or something else.  Here's the relevant line from /etc/fstab: 

```
/dev/dvd        /mnt/cdrom      iso9660 noauto,ro,user          0 0
```

that looks right to me, and I can mount it as root with the command 

```
mount /dev/dvd
```

without complaints.  So my assumption is that it's not a problem with fstab.  

the user is part of the cdrom group:

```
dan@pascal ~ $ groups

disk wheel audio cdrom video games usb users portage media web
```

which appears to be the owning group of /dev/dvd according to /etc/udev/permissions.d/50-udev.permissions:

```
dvd:root:cdrom:0660
```

the rules file doesn't  seem to have much to say about it...

```
dan@pascal ~ $ cat /etc/udev/rules.d/50-udev.rules | grep cd

# cdrom symlinks and other good cdrom naming

BUS="ide",  KERNEL="hd[a-z]",  PROGRAM="/etc/udev/scripts/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"

BUS="scsi", KERNEL="sr[a-z]",  PROGRAM="/etc/udev/scripts/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"

BUS="scsi", KERNEL="scd[a-z]", PROGRAM="/etc/udev/scripts/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"

#  /dev/ide/.../{disc,cd} and /dev/{cdroms,discs}/* type names

```

every line is commented out in /etc/udev/cdsymlinks.conf and /etc/udev/scripts/cdsymlinks.sh is a 184-line long shell script that (although I may have missed it) doesn't seem to have anything to do with permissions.  

when I try to mount /dev/dvd as my nonroot user, here's what happens:

```
dan@pascal ~ $ mount /dev/dvd

mount: must be superuser to use mount
```

FYI, I don't really need to be able to mount it myself, but dvdrip needs to be able to mount it evidently.  

```
Failed to copy the IFO files. vobsub creation won't work properly.

(Did you specify the mount point of your DVD drive in the Preferences?)

The error message is:

Failed to mount DVD at /mnt/cdrom (mount: must be superuser to use mount)
```

I have discovered that I can mount it as root beforehand, and that works ok, but I would like it if i didn't have to deal with the command line and a gui interface.  ( I have given up on the command-line use of dvdbackup to rip dvds because I have tried several different dvds without any success.  I think the problem had something to do with multiple angles and multiple audio tracks, but that's just a guess.  anyway, that has little to do with this post.)

any suggestions?  Or do I just have to do it the hard way?

----------

