Linux – FAT32 and /etc/fstab Configuration

fatfstablinuxmount

I mounted a FAT32 drive onto my Linux computer using the following terminal command:

> sudo mount /dev/sdb1 /media/exampleFolderName -o dmask=000, fmask=111

I did this so I could share / edit the files over a network connection. Unfortunately Linux doesn't support per file permissions in FAT32 format, so this sets the entire drive in the right permissions whilst it's connected.

If I understand mount correctly, I'll have to do this every time I plug the drive in, which I don't want to do. I've heard about:

/etc/fstab

So my question – how do I turn the above mount command into an fstab entry? If anyone could also explain what dmask and fmask mean, that would be appreciated.

Best Answer

You probably want to add a line like

/dev/sdb1 /media/drive1 vfat dmask=000,fmask=0111,user 0 0

to /etc/fstab. The additional ,user in the options field allows any user to mount this filesystem, not just root.

Related Question