[Samba] USB Drive Permissions?

Chris Weiss
Tue, 04 Oct 2011 17:26:16 -0000

On Tue, Oct 4, 2011 at 12:11 PM, Nicholas Oleksinski <noleksin at
gmail.com> wrote:
> I just installed Samba on my Karmic box and I am trying to share a USB
drive
> that has been mounted to /media/Personal1.
> 1) It is owned by noleks (me)
> 2) Its permissions are 700, unchangeable (?)

To change default permissions, you'd have to consult your automounter
docs.  As most usb sticks are fat32, they don't actually have
permissions, so what you are seeing is a posix permission emulation
layer in the vfat fs driver, which is controlled by mount flags.

However, and a bigger problem, is that when you make a share on a
mount point and the connect to it, smbd will tend to lock the mount
point and you won't be able to cleanly unmount the disk without
manually killing the smbd process that has it locked.

What I have done in the past is to share out /media with the "force
user" option so that access to the usb disks is done as my desktop
login user.  As I recall, this locks /media but not /media/Personal1
so that issue is resolved.  The force user option is a lot easier to
deal with than automounters.  And sharing /media means all your usb
drives will work without adding a share for each one.  you also get
cd/dvd-rom sharing.