Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up a linux to act as a fileserver, using CentOS 6.3.

Since I want to have disk quotas and can't install LVM (it is a 32 bit machine), I am using an LVM volume with ext4 mounted as /samba/seg

I have created /samba/seg, assigned a domain group, changed FS permissions to 770, executed:

  • semanage fcontext -a -t samba_share_t /samba/seg
  • restorecon -R -v /samba/seg

My config (from testparm):

       comment = Remote unit
       path = /samba/seg
       valid users = @DOMAIN\GROUP
       read only = No
       create mask = 0660
       force create mode =  0660
       directory mask = 0770
       force directory mode = 0770
       hide unreadable = Yes
       access based share enum = Yes

When I try to connect from a Windows box (logged as domain user) I get a message stating that I have no access rights to the share. I have to make setenforce Permissive in order to access the share.

The domain configuration seems ok. I can login with a domain user, check users of domain groups and so on.

In the other hand, I just did create a directory (not a filesystem) in /samba/test and replied the steps with it; it worked without problem so the issue seems to be when sharing a mounted filesystem.

Any suggestions? I am fairly new to managing Linux, so don't overlook noob issues.

share|improve this question
up vote 0 down vote accepted

Ok, my bad. I keep repassing the process, and investigating what did the instructions do.

When looking at semanage found ls -Z and I found that the samba_share_t permission/object/whatever was not sticking to the mounted filesystem.

What I did was change fstab to add a mount option, now it reads

/dev/mapper/VolGroup-lv_seg       /samba/seg    ext4    context="system_u:object_r:samba_share_t:s0" 1 2 

That did the trick.

share|improve this answer

Your Answer


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.