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.
Your problem seems to be about the permissions you have set. FAT / FAT32 formatted drives don't support file permissions. The permissions for everything are determined by how the drive is mounted. When you set the permission open it worked when you
server# sudo mount /dev/sdb2 /home/storage -o umask=000
As for it not auto mounting on reboot
UUID=8C52-C1CD /home/storage auto user,umask=000,utf8, -->noauto<-- 0 0
The "noauto" makes this NOT automatically mount when the system starts and parses the /etc/fstab file. Remove that option and it will mount on startup. You can set the permissions on the mount point once it's mounted with chmod
or specify them in /etc/fstab.
If you need the media user to access it, you can set the permissions to 764, and add them to the security group. Root always has access to everything.
see http://www.linux.org/threads/file-permissions-chmod.4094/ for some examples of propper file permissions
On a side note, bodhi.zazen made a good point
Is there some reason you need to use FAT ? If not, I would back up the data and use a linux native file system. You can then set ownership and permissions.
Best 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:
$ 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.