[Samba] USB Drive Permissions?

Nicholas Oleksinski noleksin at gmail.com
Tue Oct 4 12:55:48 MDT 2011


More...

Here is the mtab entry:

noleks-ub:~> cat /etc/mtab
/dev/sda1 / ext4 rw,errors=remount-ro 0 0
proc /proc proc rw 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
none /dev devtmpfs rw,mode=0755 0 0
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
none /dev/shm tmpfs rw,nosuid,nodev 0 0
none /var/run tmpfs rw,nosuid,mode=0755 0 0
none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0
none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/noleks/.gvfs fuse.gvfs-fuse-daemon
rw,nosuid,nodev,user=noleks 0 0
*/dev/sdb1 /media/Personal1 fuseblk
rw,nosuid,nodev,allow_other,blksize=4096,default_permissions 0 0*

I think I'm real close here as a result of Chris' guidance.
Is there a way to control what options the automounter uses when I plug in
the drive?

On Tue, Oct 4, 2011 at 2:31 PM, <noleksin at gmail.com> wrote:

> Hi Chris
> An update...
> Sharing /media worked, but I still cannot access /media/Personal1, which is
> actually a Western Digital portable HD.
> I can see all the directories in /media. I made a test folder called
> public, chmod 777, and I can edit files in there from my client.
>
> The Disk Utility reports that the drive is Partition Type HPFS/NTFS, Type:
> NTFS.
>
> Not sure how to figure out what Ubuntu is using for automount...
>
>
> On , noleksin at gmail.com wrote:
> > Hi Chris:
> > Thanks for the help. I will investigate the automounter documentation re:
> filesystem types and permissions.
> > Can you help me understand what "Force user" mode is?
> > I am going to try to share /media with "User" authentication mode.
> > Thanks again
> >
> > On , Chris Weiss cweiss at gmail.com> wrote:
> > > 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.
> > >
> > >
>


More information about the samba mailing list