On Thu 28 Jul 2022 at 14:49:03 (-0700), pe...@easthope.ca wrote:
> https://tldp.org/FAQ/Linux-FAQ/partitions.html has this example.
> 
>  $ mkdir /dos $
> mount -t msdos -o conv=text,umask=022,uid=100,gid=100 /dev/hda3 /dos
> 
> Therefore a new file receives permissions 755.  Correct?

With these options, that's what the driver will present to you.
But the filesystem will just write a read/write file.
(BTW I wouldn't use the parameters in that somewhat dated example.)

> But a FAT file has only all-user read-only permissions.  Either 777 or 555.  
> Correct?

If you mean the file as stored in the filesystem, yes, it either
has the readonly attribute or it doesn't.

> Explanation?

The permissions as you see them are determined by the mount parameters
that you specified with umask (or fmask/dmask), except that a readonly
attribute in the filesystem will lose you any w permissions you might
have expected from the mask.

When you copy files that have varied permissions onto the FAT, you may
get warnings about permissions that can't be honoured. (IIRC, copying
ug=r,o= would not complain, whereas u=r,go= would.)

I don't know whether/which permissions/attributes are honoured when
you're root (for you, all the time), as I only mkdosfs or dd FAT
filesystems as root.

Cheers,
David.

Reply via email to