Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I connect my HTC Incredible S to my Ubuntu 10.10 system as a USB drive, the device seems to mount OK, but is read-only unless I access it as root. For example, if I run nautilus, I can't drag and drop files to the SD-card in the phone, but if I run sudo nautilus I can.

I have USB debug support set on the phone (Applications > Development > USB debugging) and I have added a rule for the device in /etc/udev/rules.d/51-android.rules on my Ubuntu system. Any suggestions as to how I can mount the drive so that I can copy content to the SD card without needing to sudo?

Update

Following advice from waltinator, I added the following line to my /etc/fstab:

UUID=3537-3834 /media/usb1 vfat rw,user,noexec,nodev,nosuid,noauto

However, the Android device is still being auto-mounted on /media/usb1 with uid and gid root.

Update 2

syslog output:

Nov 21 23:38:40 rowan-15 usbmount[4352]: executing command: mount -tvfat -osync,noexec,nodev,noatime,nodiratime /dev/sdd1 /media/usb1
Nov 21 23:38:40 rowan-15 usbmount[4352]: executing command: run-parts /etc/usbmount/mount.d
share|improve this question
add comment

1 Answer

Find the UUID of the Android, with sudo blkid, then add a line to /etc/fstab that looks like:

UUID=<from above>  <mount point>  <type>  rw,users,noexec,nodev,nosuid,noauto    

You can find out the of filesystem the Android has by issuing mount while it is plugged in. man mount will explain the options.

New method: Plug in your Android, hit F1 in the automounted and opened Nautilus window, to bring up the "Ubuntu Desktop Guide", search for the article "Open an application when you plug in a device" - it will show you how to open NO application when you plug in your device. It still gets automounted, in spite of noauto for me.

share|improve this answer
    
Duh! You can find out the type of the filesystem ... –  waltinator Nov 19 '11 at 22:44
    
OK, I tried this and it's not working. Correct me if I'm wrong, but the noauto flag should mean that the device doesn't automount when it's connected, right? That's not happening though - it still gets mounted on /mount/usb1 a few seconds after connecting the USB cable. Part of the problem, I think, is that I don't properly understand how Ubuntu handles these USB devices. Pointers to any documentation I should be reading would be welcome. –  Ian Dickinson Nov 20 '11 at 13:13
    
"I tried this and it's not working" contains insufficient detail. What did you do, what was the computer's response, how does this differ from what you expected? –  waltinator Nov 20 '11 at 23:24
    
Sorry, I thought that was clear. As I wrote in my edits to the question, I added a line to /etc/fstab based on your suggestion. As I understand the noauto flag, this means that connecting the device to the USB cable should no longer automount the file system, but the user flag should mean that I can mount it manually without sudo. However, the automount still happens, and the file system is mounted with uid and gid root. –  Ian Dickinson Nov 21 '11 at 11:52
    
Check the man page for mount (man mount), and look for "Mount options for <type>", will it let you specify "UID=" and "GID="? –  waltinator Nov 21 '11 at 19:43
show 4 more comments

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.