[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] FAT32 under Linux
On Wed, Mar 17, 2004 at 05:21:59PM -0000, J.White wrote:
> Hi Guys,
>
> This is driving me nuts, maybe somebody has a solution.
>
> I've added a new internal IDE 120 gb drive to a dual WinXP/RH8.0 system.
> I wanted it to be visible under both so I used Partition Magic 8
> under XP to create 2 partitions (1 gb Linux swap, 118 gb FAT32).
>
> Under XP all ok, mounts and everybody can write to it.
> Under Linux did: mkfs -t vfat -F32 /dev/hdb5
> So far so good, edited fstab as below 1st /data5 line,
> mounted it ok, cd /data5, mkdir /paul on it fine, then tried to
> chmod a+w paul (as root) and the blasted thing says no
> permission! Neither will it let root chown it to belong to paul.
> Can't chmod or chown /data5 or any file root writes to it.
> And of course paul can't write to it until I manage this so simple job.
> (Oddly enough, paul can delete a file he wrote under XP).
1st rule. You can't chmod, chown, chgrp or anything like that a fat
filesystem. It simply doesn't support it.
So, how do you set permissions etc? You have to set them at mount time.
You can do this either by passing them to mount, or by setting them in
fstab.
The options you'll be most interested in are.
uid
gid
umask
posibly dmask as well, although I've not used it myself.
You want to set uid = to the uid of the user you want to own the files,
and gid = to the group. I set uid = 0 and gid equal to a group I call
dos. I then add people to the dos group who can access files on the fat
system.
umask is a funny one. It's the octal setting of the permissions you
DON'T want to grant.
I have mine set to 007 which grants rwxrwx---. Which is read, write and
execute permission to user and group, and nothing to world.
Why grant execute permissions? Well, without the execute permission on a
directory, you won't be able to list the file contents. I'd not seen the
dmask option before, so I might have to try that myself some time.
I also set noexec, so nothing on there is actually executable.
My line in fstab is
/dev/hda1 /dos/c vfat uid=0,gid=102,umask=007,noexec 0 0
Hope this helps!
>
> This is ridiculous, both /share and /mnt/1394 (firewire external)
> are FAT32 and work fine under Linux. I've done something stupid
> but don't see it.
>
> Cheers, Jan
>
> lino5:/etc/fstab
> ===========
> LABEL=/ / ext3 defaults 1 1 # /dev/hda5
> LABEL=/boot /boot ext3 defaults 1 2 # /dev/hda3
> /dev/hda2 /share vfat defaults 1 1
> /dev/hda6 swap swap defaults 0 0
> /dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,rw 0 0
> /dev/fd0 /mnt/floppy auto noauto,owner,kudzu,rw 0 0
> /dev/sda1 /mnt/1394 auto noauto,user,sync,exec,rw 0 0
> #/dev/hdb5 /data5 vfat defaults,rw 0 0
> #/dev/hdb5 /data5 vfat users,sync,exec,dev,suid,rw 0 0
> /dev/hdb5 /data5 ext3 defaults 0 0
> /dev/hdb6 swap swap defaults 0 0
> odin1:/d1a /d1a nfs rw,bg,soft,intr 0 0
> ...
>
P.S. If you set uid=0, you *definately* don't want the suid flag on it
as well. I don't know why your /share mount works OK.
--
Hulver's site. Community blogging site running scoop.
http://www.hulver.com/scoop/
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.