Tomas Mackevicius
2008-Jun-17 02:39 UTC
[Samba] Strange Samba permissions on vfat (fat32) volume
I'm running Samba on Ubuntu server. I know, perhaps it is not related with Ubuntu Server 8.04, but rather with Samba itself, but I thought perhaps someone has similar experience... I have a couple of shares on Samba on a vfat (fat32) volume. As everybody knows Linux permissions does not work on vfat, except on mount folder where vfat partition is mounted. I though that is really not a minus, but a plus if you want to create share for 10-15 users, because then it's not necessary to mess with all those permissions. So, recently I have noticed, that I cannot delete some of the files on that share, even if the share is mounted with fstab option: /dev/sdb1 /mnt/320gb/disk_c vfat utf8,noatime,umask=007,gid=1003 0 0 I have tried umask=000, but that didn't help either... Interesting part is that I could delete most of the files, but not those couple. I compared permissions of the "normal" files and those "bad" ones from the Windos XP box. Normal files had All permissions available in comparison with bad files that had only Read-Execute and Read permissions available. On server permissions looked like this: Normal file: -rwxrwxrwx 1 root server1 6158201 1999-05-05 21:36 Alex Gopher - Super Disco.mp3 Bad file: -r-xr-xr-x 1 root server1 2568192 2001-10-04 16:52 Bjork - All Is Full Of Love.mp3 I realized that some of the "bad" files where copied to vfat partition from CD drive (when this HDD was still on a windows PC). So the logical thinking would suggest, that those files have Read Only mark (which is usually given to all files that are copied from CD). Knowing this I tried to play with smb.conf options: delete readonly = Yes map readonly = No / Yes I didn't get any results. I tried to change other map options but with no results either. Permissions were not intact. My Only idea is that somehow Samba is interpreting Read-Only flag and that affects the file permissions. I would really appreciate any comments or ideas. Here are the settings of my share: [320GB_C_full] path = /mnt/320gb/disk_c/ available = Yes browseable = Yes read only = No follow symlinks = No hide dot files = Yes delete readonly = Yes case sensitive = No preserve case = Yes map archive = Yes map system = No map hidden = No map readonly = No guest ok = No oplocks = No level2 oplocks = No Thanks to all.
Michael Heydon
2008-Jun-17 03:26 UTC
[Samba] Strange Samba permissions on vfat (fat32) volume
Tomas Mackevicius wrote:> I'm running Samba on Ubuntu server. I know, perhaps it is not related with Ubuntu Server 8.04, but rather > with Samba itself, but I thought perhaps someone has similar > experience... > >Actually I don't think it has much to do with samba either.> > I have a couple of shares on Samba on a vfat (fat32) volume. As > everybody knows Linux permissions does not work on vfat, except on > mount folder where vfat partition is mounted. I though that is really > not a minus, but a plus if you want to create share for 10-15 users, > because then it's not necessary to mess with all those permissions. >You could achieve the same thing under a fully functional fs and wouldn't run into problems like this :)> <snip> > > > Normal file: > -rwxrwxrwx 1 root server1 6158201 1999-05-05 21:36 Alex Gopher - Super Disco.mp3 > > > Bad file: > -r-xr-xr-x 1 root server1 2568192 2001-10-04 16:52 Bjork - All Is Full Of Love.mp3 > >I think this is your problem.> > I realized that some of the "bad" files where copied to vfat partition > from CD drive (when this HDD was still on a windows PC). So the logical > thinking would suggest, that those files have Read Only mark (which is > usually given to all files that are copied from CD). Knowing this I > tried to play with smb.conf options: > > > > delete readonly = Yes > > map readonly = No / Yes >That isn't how it works, the map read only maps the client's read only value to the server's unix permissions, what you are interested in is how the unix permissions are mapped to the file system's read only flag.> > I didn't get any results. I tried to change other map options but with > no results either. Permissions were not intact. My Only idea is that > somehow Samba is interpreting Read-Only flag and that affects the file > permissions. >It isn't samba as you demonstrated with your ls output above, it is occuring at the file system level.> > I would really appreciate any comments or ideas. Here are the settings of my share: > > available = Yes >Default value.> browseable = Yes >Default value.> read only = No > > follow symlinks = No >Symlinks can't exist on a fat fs.> hide dot files = Yes >Default value.> delete readonly = Yes > > case sensitive = No >Default value.> preserve case = Yes >Default value.> map archive = Yes >Tries to change unix permissions, which wont work on a fat fs.> map system = No >Tries to change unix permissions, which wont work on a fat fs.> map hidden = No >Tries to change unix permissions, which wont work on a fat fs.> map readonly = No >Tries to change unix permissions, which wont work on a fat fs.> guest ok = No >Default value.> oplocks = No > > level2 oplocks = No > > Thanks to all. > >None of that should have any effect on the problem at hand, but it is kind of pointless to define a heap of options to their default value. *Michael Heydon - IT Administrator * michaelh@jaswin.com.au <mailto:michaelh@jaswin.com.au>