Automatically mounting all volumes at boot

Rigved Rakshit r.phate at gmail.com
Thu Mar 8 07:31:23 UTC 2012


>
> >> > 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'.
>
> 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.
>

In my case, I was unable to read/write to the FAT32 partition earlier. But
after I set the permissions to 777 for the FAT32 partition (which is just a
folder under /media/), it solved my problem.


> 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.
>

Yes. I am talking about this emulation itself. After you have mounted the
partition with the 'exec' command, try 'chmod -x junk.sh' and then, you
should not be able to run the shell script. Similarly, if you do 'chmod 555
' to the patition, you will not be able to write to the partition as a
normal user. Or, if the partition is owned by root and permissions are 755,
you will not be able to write to the partition as a normal user.

Best Regards,
Rigved Rakshit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20120308/05ca578f/attachment.html>


More information about the ubuntu-users mailing list