Mounting vfat with read write permissions on Gnu/Linux
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4128
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
I have a kobo ebook reader that was refusing to automount when plugged in via usb, looking at dmesg I saw it present.

This forum post solved it: www.daniweb.com/hardware-and-software/linux-and-unix/threads/22358/mounting-a-fat32-drive-in-linux (DMR)

:: Quote ::
In terms of the way rwx permissions work with FAT32 mounts:

The default permissions for a mounted FAT32 volume are rwx for root, but only rx for normal users.

In Linux, permission control works differently for FAT32 and NTFS filesystems than it does for native Linux filesystems (ext2, ext3, reiser, etc.):

1. The UNIX permissions of a directory onto which you mount a Windows filesystem can't be changed while the fileystem is mounted. Unmount the Windows partition; you should then be able to chmod the permissions of /mnt/Windows. You will need to set the appropriate Linux rwx permissions on the /mnt/fat folder and set the permissions for the FAT partition (as described below) in order to grant everyone write access.

2. Windows doesn't support UNIX-style permissions, and you can only apply permissions to the entire filesystem, not to individual Windows files/folders. This is done with the "umask" option of the mount command. In /etc/fstab, change the mount entry for your Windows partition to this:

/dev/hda6 /mnt/fat vfat users,defaults,umask=000 0 0

(the "users" option allows anyone to mount/unmount the drive and overrides the default , which is that only root is allowed to mount/unmount.)

- When issuing the mount command manually, the syntax is:

mount -t vfat -o umask=000 /dev/hda6 /mnt/fat


The value of the permission bits used with umask are the opposite of those used with the chmod command. For example, the following pairs are equivalent:

umask=000 and chmod 777
umask=022 and chmod 755


So the mount the drive so users could write and modify it:

assuming drive is /dev/sde (note that newer linux do not use a number on usb mounted partitions) and mount location is: /home/me/media and the file system is vfat.

:: Code ::
mount -t vfat -o umask=000 /dev/sde /home/me/media


then it mounts as expected, with full read write permissions for user.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours