Mounting a Windows fat32 partition

I have my data like music,etc stored in a fat32 partition so I can work with it both in linux and Windows. The partition is mounted and I can read and write which is what I want. However, the files and folders on the partition are all mounted with owner = root. Same thing holds when creating new files and folders, I can create them with user account, but the owner is set to root instead of me. This wouldn’t be a problem until I tried this:
downloaded a tar archive and placed it in the fat32 partition. When I try to extract the archive it tells me that permission is denied… Strange since the users groep has rights to read and write.

So what should I change in the partition module in yast or in fstab to solve this?

You should make the entry in fstab to be like this:

/dev/sda3       /mnt/fat32       vfat       users,gid=users,umask=0002,utf8=true 0 0

Then you should make a directory for each user, owned by that user, in the root of the partition and each user can start its directory tree in that “personal” rootlike folder.

If only one user, e.g. freddie, then make fstab like this:

/dev/sda3       /home/freddie/fat32       vfat       uid=freddie,gid=users,utf8=true 0 0

FFI look here: Suse: HowTo set disk access permissions for Fat32 (VFAT) on a desktop PC

Swerdna

Thx, using uid makes me the owner. Extracting files still doesn’t work though. This time the error is:

Can’t change mode to rwxr-xr-x: not allowed (Could be slightly different in English since I had to translate)

Maybe the file is still owned by root since it started as root’s file? Try changing it to yourself.

No I am the owner, just checked it…

You’ve mounted the partition correctly – something else must be wrong. Just as a diagnostic thing, try to copy it to a normal filesystem, like in /home/username somewhere, and see if it unpacks there – it’s quite interesting.

And also, tell us a little more about the archive file and its actual permissions.

Have you tried mounting the partition to a directory for which the user and group is yours, rather than root?

when put the archive in my homefolder and extract it there is no problem.

-rwxrwxr-x 84291-helsinki.tar.gz -> in home
-rwxrwxr-x 84291-helsinki.tar.gz -> in fat

the archive is just a archive from gnome-look, nothing special, and it also happens with other archives.

I also noticed that when I use file roller to first open the archive and then drag and drop the files into fat it does extract them (and also gives the same error as listed above). When I just rightclick and press ‘extract here’ I only get an error without extraction.

So this could be a bug of file roller?

So this could be a bug of file roller?

I really don’t know, being a KDE user. But I think to say “yes” to the bug question would just be a cop out. It should work OK. I installed file roller, which is a GUI for “unrar” and tried it out on something I made as filename.tar.gz. It worked OK, although cumbersome.

So I can’t really help further except to suggest trying a different unzip programme.

Try unmounting your fat partition and in yast2 partitioner do the mounting (be sure to put a mount point like so:/fat partition" and just accept the default

It seems the problem only appears with tars. I tried a zip archive and no errors appeared.

Well that’s new information for me. I suppose since

  1. fat32 is essentially a world-writeable filesystem*]Linux tricks it up to temporarily have Linux-like permissions that change depending who mounted the partition*]tar is an archiver which tries to preserve user and group IDs
    then strange things can happen. But that is of course a bit of a cop out instead of giving you a clear way to cope with it.

I know one clear way to cope with it: use a Linux filesystem – sometimes an impractical suggestion.

fixed it by mounting with umask=0022 instead of 0002