LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot change mode on vfat partition (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-change-mode-on-vfat-partition-106503/)

ffang 10-20-2003 07:59 PM

Cannot change mode on vfat partition
 
I have a vfat partition and can move files around as a root user. I want other users can do the same thing. So I login as root and issued the command:

chmod -R 777 sharedir (at vfat partition)

However, I keep getting the following error message.
chmod: changing permissions of `xxxx' (requested: 0777, actual: 0755): Operation not permitted

I was ROOT at that time. Anyone knows the reason?

Thanks,

ffang

neo77777 10-20-2003 08:57 PM

The reason is simple FAT partition being a propriatery toy from a well known company isn't aware of linux permissions. To set it up you need to edit
/etc/fstab file
put the line there
/dev/hdb1 /mnt/windows vfat noauto,user,owner,umask=0770,rw 0 0
P.S. Assuming your windows fat partition is on /dev/hdb1 and the mount point is /mnt/windows

ffang 10-22-2003 04:57 PM

Thanks, it works.

megaspaz 10-22-2003 05:00 PM

don't use the umask=0770. that yields a mount permissions of:

--- - --- - rwx

where the owner of the partition (default is root) and group owner of the partition (default again root) have no access.

if you don't want to make groups to have certain users have full access to your partitions and just want to have everyone under the sun be able to troll around your windows partitions, use umask=0000. this yields a mount permissions of:

rwx-rwx-rwx

edit: if it were me, i'd do something like this in fstab:

/dev/hda1 /mnt/c vfat auto,owner,gid=windows,umask=0007,rw,exec 0 0
/dev/hda5 /mnt/d vfat auto,owner,gid=windows,umask=0002,rw,exec 0 0

explaination:
/dev/hda1 = windows C:\
/dev/hda5 = windows D:\

umask=0007 -> mount permissions of rwx - rwx - ---
umask=0002 -> mount permissions of rwx - rwx - r-x

basically for windows, i have it set for other to have no permissions due to the fact that allowing others to have read/exec access can constitute a security hole in that other user's can grab password files from windows, windows apps, and 3rd party apps that use passwords when logged into linux. but i would then create a windows group and put in users that i want to have full permissions on windows partitions, like your user account for convenience. setting a umask to 0002 will still let other users read/exec files/directories on that partition. anyway, for me mounting windows partitions should be thought out on what kind of permissions you wish to set. it also helps to figure out where 3rd party apps that do use passwords where they store those passwords so you can secure that partition accordingly. after all, you spend all that time to secure windows when you boot into windows, it doesn't make sense to leave windows open when booted in linux. of course this depends how you're going to use your computer. if you're the only one going to use this computer then, all this is pretty overkill. if going to allow multiple users like i do, then you might want to take into consideration such things. also take into account what might happen if one of your accounts gets hacked and owned. just my 2 cents.

DMR 10-22-2003 05:07 PM

Actually, you can change the permissions of mount point itself (because it's a normal Linux directory), but you can't change them while a Windows filesystem is mounted there. It won't do the trick anyway though, because when the Win filesystem gets mounted the default mask (write permissions for root only) will be applied. That's where the "umask" option comes into play- it overrides the default.

:)

megaspaz 10-22-2003 05:23 PM

Quote:

Originally posted by DMR
Actually, you can change the permissions of mount point itself (because it's a normal Linux directory), but you can't change them while a Windows filesystem is mounted there. It won't do the trick anyway though, because when the Win filesystem gets mounted the default mask (write permissions for root only) will be applied. That's where the "umask" option comes into play- it overrides the default.

:)

absolutely correct.

DMR 10-22-2003 05:39 PM

Quote:

Originally posted by megaspaz
absolutely correct.
Belive me, I know... I learned it the haaard way!:(

:p


All times are GMT -5. The time now is 07:05 PM.