Automatically mounting all volumes at boot

Kevin O'Gorman kogorman at gmail.com
Wed Mar 7 16:24:34 UTC 2012


On Wed, Mar 7, 2012 at 6:57 AM, Rigved Rakshit <r.phate at gmail.com> wrote:
>> > sudo chmod -Rv 777 /media/MyFat32System
>>
>> Since fat has no understanding of unix filesystem permissions, and
>> chmod no understanding of fat's, this will never have any effect on a
>> fat filesystem.
>
>
> It is the OS which implements and enforces the permissions. So, even though
> Windows cannot understand unix fs permissions, Linux can. For example, if
> you create a '.sh'  on a NTFS or FAT32 fs, you cannot execute the program in
> Linux until you give the file execute permission using .chmod +x
> filename.sh'.
>
> Best Regards,
> Rigved Rakshit

Rigved, you didn't actually try that, did you?  The "chmod +x" command has
no effect on anything in a FAT filesystem, because there is no execute
permission on that system.  The capability simply does not exist there.

Rather, most permissions are faked by the Linux virtual filesystem, giving
the best approximation they can.

The ability to execute files on a vfat filesystem is controlled by a
parameter to
mount.
Consider the following session:

kevin ~ $ sudo mount -o noexec /dev/sdd1 /mnt/junk
kevin ~ $ cd /mnt/junk
kevin junk $ ls -l junk.sh
-rwxr-xr-x 1 root root 30 2012-03-07 07:25 junk.sh
kevin junk $ cat junk.sh
#!/bin/bash
echo running junk
kevin junk $ ./junk.sh
-bash: ./junk.sh: Permission denied
kevin junk $ chmod +x junk.sh
chmod: changing permissions of `junk.sh': Operation not permitted
kevin junk $ cd
kevin ~ $ sudo umount /dev/sdd1

kevin ~ $ sudo mount -o exec /dev/sdd1 /mnt/junk
kevin ~ $ cd /mnt/junk
kevin junk $ ls -l junk.sh
-rwxr-xr-x 1 root root 30 2012-03-07 07:25 junk.sh
kevin junk $ ./junk.sh
running junk
kevin junk $ cd
kevin ~ $ sudo umount /dev/sdd1

The results could look a bit different if there were an fstab entry
allowing user mounts for this drive, but there would still be no
execute bit in a VFAT partition.

-- 
Kevin O'Gorman, PhD




More information about the ubuntu-users mailing list