FAT permissions problem

Q I decided I would try putting Ubuntu on a USB stick. But the extra area I allocated for my data files is read and execute only. All directories and files are owned by root. The USB stick partition for /dev/sdb1 is mounted on /cdrom and is a W95 FAT32 (LBA). As root in my hard disk system, I copied my data files to this partition. But I cannot change the ownership of the directories to my user account even as root, as I don't have permissions. Why?

A FAT32 doesn't support file permissions and ownerships. You can give a default owner or group permissions for everything via the options given to the mount command, or in /etc/fstab.

The options you can use are umask to affect the permissions and uid/gid to set ownerships. Add umask=000 to the options given to mount, or change the

/etc/fstab line to something like
/dev/sdb1 /cdrom vfat umask=000 0 0

The umask is subtracted from 666 for files and 777 for directories to give the actual permissions, so all directories will be rwxrwxrwx and all files rw-rw-rw-. Alternatively, you can specify the user or group owner

/dev/sdb1 /cdrom vfat uid=david 0 0

UIDs/GIDs can be names or numbers. Combine options too:

/dev/sdb1 /cdrom vfat gid=users,umask=002 0 0

Everything is group writeable and owned by the group users here.

None of this metadata is saved to the filesystem; it's just to make a permissionless, ownerless filesystem work with an OS that expects such attributes. Change these settings for a mounted filesystem, like so:

mount /cdrom -o umask=000,remount

Follow us on Identi.ca or Twitter

Username:   Password: