2

I have a FreeBSD 10.3 installation in which I have configured to automount removable storage (i.e. USB flash or hard disks). Automount does work except the permissions are incorrect. Users can read and execute, but cannot write. To write to the USB storage device, you need to be either root or use sudo.

First off, there are several similar questions here (i.e. USB drive permissions when automounting), but they are Linux based which means they use udev while FreeBSD uses devd

Per the instructions in the FreeBSD Handbook Chapter 17.4.2, I am able to mount my USB devices in the /media directory. Issuing ls -la /media as a regular user I get:

$ ls -la
total 14
drwxr-xr-x   3 root  wheel  512 Apr 14 18:56 .
drwxr-xr-x  19 root  wheel   26 Apr 14 14:56 ..
drwxr-xr-x   3 root  wheel  512 Apr 14 10:52 DataDisk
drwxr-xr-x   3 root  wheel  512 Apr 14 19:02 FAT32

As you can see, I have two disks automatically mounted - "DataDisk" and "FAT32". I can browse either drive and even run scripts from either drive which is correct; the permissions are indicated above.

But, I cannot write.

The user in question is a member of the wheel group. If I manually set the permissions (chmod 660 /media/DataDisk), everything works until I unmount/remount or reboot.

I am guessing that I need to set the permissions (as options) in /etc/auto_master but the FreeBSD man page is so vague, I am not sure what to do.

Can someone point me in a direction to solve this?

Allan
  • 1,040
  • Are these both msdosfs filesystems? – Mark Plotnick Apr 15 '17 at 00:50
  • No. One is UFS with GPT and the other FAT32 with MBR. Both exhibit the same symptom. Is it relevant? – Allan Apr 15 '17 at 01:07
  • There's a mount option to force writability of every file and directory on an msdosfs, but not on a ufs. I thought DataDisk might be msdosfs because you said chmod 660 fixed things, but on ufs that would deny access to everyone but root because there's no 'x' permission. (770 would be more typical). I will try to reproduce your problem. – Mark Plotnick Apr 15 '17 at 09:24
  • The chmod 660 "worked" for me because I only need rw permissions, not x. I guess a more tangential question would be - how are folks mounting USB devices under FreeBSD? According to this article (from the guy who worked on the automounter - it's works similar to OS X. OS X allows the user to read and write so I guess I would love to know what OS X is doing differently... – Allan Apr 15 '17 at 13:00

0 Answers0