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?
-
1If 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..– karthick87Dec 15, 2010 at 10:21
-
3Yes, 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.– asteriskDec 15, 2010 at 10:49
-
No EASY way in 2019?? No plug-and-play to do that with UBUNTU 18 LTS??– Peter KraussAug 26, 2019 at 10:22
1 Answer
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.
-
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.– asteriskDec 15, 2010 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!– asteriskDec 19, 2010 at 17:05
-
1Hi, 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– pacometMay 18, 2012 at 12:38
-
-