Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am attempting to mount my Amazon Kindle, 3rd Edition. It automounts correctly and when I run mount -l, I get the following output:

/dev/sdg1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime) [Kindle]

From this output, it appears to me that I should be able to read and write to the file system.

Unfortunately, when I try to copy any files to the Kindle, I cannot do it as a regular user. I do have pmount setup on my machine, so I'm not sure if that is causing the problem...haven't been able to find any additional information about it in regards to this kind of issue.

Anybody have any suggestions of what I may be missing here? Thank you.

Updated per Question in Comments

jascav@home:~$ id
uid=1000(jascav) gid=1000(jascav) groups=1000(jascav),4(adm),7(lp),24(cdrom),27(sudo),29(audio),30(dip),46(plugdev),104(fuse),108(lpadmin),109(sambashare),1001(power)

jascav@home:~$ ls -ld /media/usb0/
drwxr-xr-x 7 root root 8192 Dec 31  1969 /media/usb0/

Updated per Additional Discussion

I am using usbmount for my automounting solution. I use pmount so a normal user can mount the device. It appears (after further investigation) that these applications aren't working together. usbmount is doing the automounting, but it is not doing it from the user's perspective. If I pumount the device and then mount it again manually, I can write to the device.

Getting closer, but I'm still not sure how to get usbmount to honor the user. (Maybe I can't?)

share|improve this question
1  
Please add the output of the following two commands to your question: => id and => ls -ld /media/usb0 –  jippie Jun 3 '12 at 10:04
    
@jippie - Updated. Thank you. –  JasCav Jun 3 '12 at 10:29
2  
It is clear why you cannot write to it as a normal user. The owner of the mount point media/usb0 is root and (s)he is the only one with *w*rite access. You can manually change it with sudo chown jascav /media/usb0 or mount -o remount,uid=jascav /media/usb0, but the real answer to your question is how to set up the system that this happens automatically. Not sure about that unfortunately. What distribution are you using? –  jippie Jun 3 '12 at 10:39
    
@jippie - I'm using Ubuntu Server (specifically). –  JasCav Jun 3 '12 at 10:43
    
jftr how did you setup your automount? Just run pmount as a normal user? –  Ulrich Dangel Jun 3 '12 at 12:37

4 Answers 4

up vote 3 down vote accepted

Figured it out (thanks to everybody who helped jog the brain a little bit).

Because usbmount is doing the automounting, this is where the problem lay. And, conveniently enough, usbmount provides a configuration file for managing how a drive gets mounted. In order to manage this, open /etc/usbmount/usbmount.conf.

There is a line in the file that looks like this:

FS_MOUNTOPTIONS=""

Add the uid and/or the gid that you would like the device to mount as.

FS_MOUNTOPTIONS="uid=1000,gid=1000"

Now, my drives automount correctly every single time.

share|improve this answer

You need to specify a uid= option while mounting them manually , e.g

/dev/sdg1 /media/usb0 vfat defaults,uid=1000 0 0

But why did you mount that manually , does it work for you if you mount it with e.g nautilus / thunar ? (which uses udisks)

share|improve this answer
    
I'm not mounting them manually at first. usbmount is doing that automatically. However, for some reason, it is mounting read only. I need to get usbmount and pmount to work together so-to-speak. As far as nautilus / thunar, I am not using those directly. (I pretty much do everything via command line.) I do have udisks installed, however. I think usbmount brings that down. –  JasCav Jun 3 '12 at 18:58
    
With udisks it should mount automatically, but I think only if you are in a graphical environment. To use udisks manually you can say udisksctl mount --block-device /dev/sdg1 and this should take care of permissions and so on. –  Rmano Jan 4 at 1:03

I faced this issue that it was impossible to manage files on USB sticks/SD cards (write/delete) because drives were mounted by root using usbmount. My simple resolution was to remove usbmount and use hal and pmount.

Thanks for this tip in the usbmount package description:

... USBmount is intended as a lightweight solution which is independent of a desktop environment. Users which would like an icon to appear when an USB device is plugged in should use the pmount and hal packages instead.

Luckily hal and pmount are installed by default in Ubuntu:

$ dpkg -l|egrep -i "hal|pmount"
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
ii  hal                                           0.5.14-8                                   Hardware Abstraction Layer
ii  hal-info                                      20091130-1                                 Hardware Abstraction Layer - fdi files
ii  libhal-storage1                               0.5.14-8                                   Hardware Abstraction Layer - shared library for storage devices
ii  libhal1                                       0.5.14-8                                   Hardware Abstraction Layer - shared library
ii  libndr0                                       4.0.0~alpha18.dfsg1-4ubuntu2               NDR marshalling library
ii  pmount                                        0.9.23-2                                   mount removable devices as normal user
share|improve this answer

I don't want to specify a uid in the usbmount.conf file, so I used the following options instead.

FS_MOUNTOPTIONS="-fstype=vfat,flush,gid=plugdev,dmask=0007,fmask=0117"

This should work for all users that are members of the plugdev group. Unmount with pumount.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.