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.

I'm using Ubuntu 10.10 and using a usb drive but I'm finding that I can't chmod any programs on the drive to +x. It is being auto-mounted by Gnome (using udev, I think?) so I imagine the problem is a mount option but I can't seem to find a way to modify the default mount options any where. There are no entries in fstab. Anybody encounter this problem?

share|improve this question
    
If it's vfat/ntfs, you can set the default permissions with the dmask/fmask mount options mount -o umask=xxx depending on what rights you want, umask=0 will give all rights.. –  karthick87 Dec 15 '10 at 10:21
2  
Yes, but I can't seem to find out how to modify these options for when Gnome automounts an inserted device. I have it mounted manually to another location from an entry in /etc/fstab, so this will work for the time being, it's a bit inconvenient though. –  asterisk Dec 15 '10 at 10:49

1 Answer 1

up vote 8 down vote accepted

I guess your usb drive is formatted with VFAT/FAT32. This file format does not support execute permissions which is why chmod +x fails.

[Edit] Ok, had a bit of a play and search on the net. Lots of 'solutions' suggest that you should change /etc/fstab. This just seems clunky to me, what do you do? change fstab every time you encounter a new usb flash drive???

My solution:

$ sudo vi /etc/udev/rules.d/90-usb-disks.rules

Add the lines:

# UDEV Rules to change the permission of USB disks
#

KERNEL=="sd*[0-9]", ATTR{removable}=="1", ENV{ID_BUS}=="usb", MODE="0022"

$ sudo /etc/init.d/udev restart

Then try inserting a usb drive. There is probably an attribute that you can check for to ensure it's a FAT formatted drive if you wanted to be more specific.

share|improve this answer
    
It seems not, I added an entry to /etc/fstab with the options I require and I'll just have to mount it manually every time I insert it until I can figure out how to modify the default mount options. –  asterisk Dec 15 '10 at 10:46
    
Ah,this is exactly what I was looking for but couldn't find the right file. Worked like a charm, thank you! –  asterisk Dec 19 '10 at 17:05
1  
Hi, I'm trying your solution but it is not working for me. Can you take a look at my question? askubuntu.com/q/138878/25305 Thanks in advance –  pacomet May 18 '12 at 12:38

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.