# user can't mount sda1: only root can do that(SOLVED)

## gen03

hello, I read the past threads(including teh one in FAQ), and it seemed that none of those worked, the problem is that regular user can't mount my camera's(sony Cybershot P100) memory stick(permission denied), but the same user can umount it if mounting is done by root, this is the line in my fstab:

```
/dev/sda1               /mnt/usbstick   vfat            noauto,umask=000,user       0 0

```

I also tried to use 

```
users
```

instead of 

```
user
```

or even both, I also tried to use 

```
umask=0077
```

 none worked out.

also, I am using kernel 2.6.9.

thanks to everyoneLast edited by gen03 on Fri Dec 10, 2004 11:28 pm; edited 2 times in total

----------

## snizfast

What are the permissions of /mnt/usbstick ?  In the past I have had to make users the owner for this to work.

----------

## gen03

thanks for your reply

I am new to linux, could you please be a bit more specific on how to tell the permission for mnt/usbstick?

I have when I run "ls -al /mnt"

```
drwxr--r--   4 root root 16384 Jan  1  1970 usbstick

```

regards

----------

## Gentree

the permissions seem self-explanitory, you may want to look at 'man chmod'

I believe your user will need execute permission on the directory to list its contents and to mount it so that's probably what you are missing.

HTH  :Cool: 

----------

## gen03

this is strange, 

when the camera is unplugged, I did  

```
chmod +rwx /mnt/usbstick
```

and I can see that my /mnt/usbstick is now:

```
drwxrwxrwx   2 root root 4096 Nov 29 16:04 usbstick
```

I plugged in the camera, but as a user, when I run:

```
mount -t vfat /dev/sda1 /mnt/usbstick
```

I still get the message

```

mount: only root can do that

```

so when I went to mount it with 'su', and /mnt/usbstick suddenly becomes 

```
drwxr--r--   4 root root 16384 Jan  1  1970 usbstick
```

and I can't change the permission while the camera is mounted

further more, I seem to have problems umounting the camera now even from root:

```
root@tux mnt # umount /mnt/usbstick

umount: /mnt/usbstick: device is busy

umount: /mnt/usbstick: device is busy

```

what's going on?

----------

## Gentree

 *Quote:*   

>  still get the message
> 
> Code:	
> 
> mount: only root can do that

 

before you said it was "permission denied". Please report accurately the output you are getting, it helps.

check the permissions again after plugging the camera , you will probably find that something like hotplug is setting them to something else.

```
umount: /mnt/usbstick: device is busy
```

probably means you did cd /mnt/usbstick and you are still "in" the device you are trying to unmount. (check all consoles)

hth  :Cool: 

----------

## gen03

Sorry for bugging you around,Gentree, 

this is what I did: I started out by rebooting the system, after reboot, the /usbstick is 

```
drwxrwxrwx 
```

it is the same after I plugged in camera... 

problem arises when I try to mount it as a user:

```
$ mount -t vfat /dev/sda1 /mnt/usbstick

mount: only root can do that

```

so I mounted the camera at root, then,as a user, I run

 *Quote:*   

>  cd /mnt/usbstick

 

I have:

```
-bash: cd: /mnt/usbstick: Permission denied
```

this is where "permission denied comes from" and clearly, my /usbstick is now:

```
drwxr--r--   4 root root 16384 Jan  1  1970 usbstick
```

there must have been something that automatically changes /mnt/usbstick 's permission when it is mounted

----------

## blueillusion

As i understand, changing permissions for a fat32 usb stick is impossible because fat32 does not support chmods.  I am at school now so i cant tell you what umask you need, but i will tell u when i get home.  You can either give the user the permission to mount objects, or you can set the proper umask and have root be able to mount it and umount, but give users access to read and write to it.  once the fat disk is mounted, only the user who mounted it has full permissions, thats where the umask comes in hand.

----------

## blueillusion

```
/dev/sda1               /mnt/sd         vfat            sync,defaults,umask=0000        0 0

```

Try that, you dont need the sync, but that guarntees me my writes.

----------

## gen03

thanks for the reply, but it doesn't seem to work, same as before...is the user suppose to be in any special groups? I guess it doesn't matter, does it? cos I already did:

 *Quote:*   

> chmod +rwx /mnt/usbstick

 

this is applied to all users by dafault. it was true that the permission(given to user) changed after I mounted the camera as root

----------

## blueillusion

well what i do when i make a folder in /mnt is:

chgrp users /mnt/sdcard

chmod 777 /mnt/sdcard

then i mount the usb stick.  As long as your user is in the users group, your good to go. This worked on all distros i have used.

----------

## gen03

well, unfortunately, things are the same, the biggest question is after all this changes, it still comes down to

```
$ mount -t vfat /dev/sda1 /mnt/usbstick

mount: only root can do that 
```

why a reular user can't do mount when the directory is already drwxrwxrwx???

----------

## dsd

its unbelievably simple. try just:

```
mount /mnt/usbstick
```

otherwise it wont read the fstab..

----------

## gen03

wow, a breakthrough, but now I get:

 *Quote:*   

> mount: wrong fs type, bad option, bad superblock on /dev/sda1,
> 
>        or too many mounted file systems

 

if I add vfat n stuff, then I go back to the same problem as before.

----------

## gentoo_lan

What groups is your user account in?...wheel, etc

----------

## dsd

 *gen03 wrote:*   

> wow, a breakthrough, but now I get:
> 
>  *Quote:*   mount: wrong fs type, bad option, bad superblock on /dev/sda1,
> 
>        or too many mounted file systems 

 

and it definately works if you log in as root and use the exact same command? (mount /mnt/usbstick)

----------

## gen03

nope, it gives the same error as the user, but as root I can run

mount -t vfat /dev/sda1 /mnt/usbstick

the reason I am asking this is that I found it very inconvenient working as root to copy all the photos, after which,in user mode, I can not edit the photos(like rotating the photos)

I would like be able to mount/umount the camera then be able to copy photos as a user, so that I have full acess to the photos as a user, just don't know how  :Sad: 

----------

## gen03

 *gentoo_lan wrote:*   

> What groups is your user account in?...wheel, etc

 

yep, my user is in wheel, users, disk, sys,tty...

----------

## i92guboj

Are you using hal/dbus? Tried the chgrp users /dev/usbstick?

----------

## desertstalker

Try putting auto in the fs type column of /etc/fstab instead of vfat.  I have this problem with my usbstick.  If i specify the filesystem it wont mount, if i let mount do it py specifying auto it warks fine.

Hope this helps

----------

## gen03

 *6thpink wrote:*   

> Are you using hal/dbus? Tried the chgrp users /dev/usbstick?

 

first of all, thanks to all. thanks for help, really appreciated... 

I tried chgrp, even the /usbstick appeared to be drwxrwxrwx, still, I just can't mount the camera as user, the error was

```
$ mount -t vfat /dev/sda1 /mnt/usbstick

mount: only root can do that 
```

 *Quote:*   

> Try putting auto in the fs type column of /etc/fstab instead of vfat

 

nice idea, but it didn't work:

```
mount: I could not determine the filesystem type, and none was specified

```

----------

## dsd

how about (as root):

mount -t vfat -o noauto,umask=000,user /dev/sda1 /mnt/usbstick

----------

## gen03

MAGIC!!! dsd

Thank you so much, this bugged me for so long, thanks very very much!!!

yay!! I am happy now!!

----------

