Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed usbmount package on ubuntu server lucid 10.04. It worked fine. I just plug in my USB flash. The server detects it and automatically mounts it under /media/usb0.

I want this USB folder to be available as samba share. I want it to be available to everyone with full control. The problem is that the usbmount mounts it using default permissions with root as owner.

Any idea how I can configure the usbmount to do this?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You set ownership and permissions in /etc/usbmount/usbmount.conf

The file is well commented, you are looking for the section

# For example, "-fstype=vfat,gid=floppy,dmask=0007,fmask=0117" would add
# the options "gid=floppy,dmask=0007,fmask=0117" when a vfat filesystem
# is mounted.
FS_MOUNTOPTIONS=""

Enter in your options in the "FS_MOUNTOPTIONS=" line.

Example, to allow user and group, but deny otheres:

uid=your_uid,gid=your_gid,dmask=0077,fmask=0177

See man mount for options or identify the file system (NTFS / FAT) if you need assistance.

share|improve this answer

Your USB flash drive is probably formatted using FAT, which can not store Linux permissions or owner information. Because of this, the Linux kernel pretends root owns all files.

If you want to allow custom permissions, you might want to either reformat the flash drive using a file system other than FAT (ext3?). Alternatively, you should be able to override the default owner in usbmount/fstab.

share|improve this answer
    
I want to be able to access the USB flash from Windows machine. I am using samba for this. Otherwise, I don't need samba at all! Sorry, but your suggestion is not valid. I am concerned about configuring usbmount or setting the permission of the mounted USB drive. –  Khaled Dec 11 '11 at 8:32
    
My point is that the fact that the permissions don't work has nothing to do with Samba. –  jelmer Dec 11 '11 at 15:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.