Server Fault is a question and answer site for system and network administrators. 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 mounted a new drive on /New_drive my CentOS 5.7 box running Samba (3.0.33-3.29) and configured in fstab as follows:

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
**/dev/VolGroup02/LogVol00 /New_drive     ext3    defaults        1 1**

I have two folders already shared and accessed via samba.

I have user smbuser having full access to these folder from windows machines. The smb.conf file has following configuration:

#======================= Global Settings =====================================


        workgroup = lab
        server string = Samba-server1
        coding system= euc
        client code page=932
        encrypt passwords=yes
        log file = /var/log/samba/%m.log
        max log size = 50
        security = user
        passdb backend = tdbsam
#============================ Share Definitions ==============================
# Samba Files
        comment = Samba-files
        create mode=0777
        directory mode=0777
        path =/home/sambafiles
        writable = yes
        valid users = smbuser

#Samba backup  Files
        comment = Backup
        create mode=0777
        directory mode=0777
        path =/home/sambabackup
        writable = yes
        valid users = smbuser

So, set the owner and of /New_drive as smbuser and give public acess to the folder. and added New lines to the smb.conf

#New Drive
        comment = New-drive
        create mode=0777
        directory mode=0777
        path =/New_drive/sambafiles
        writable = yes
        valid users = smbuser

But, the New-drive is seen from the windows machine and is not acessible. The log file recorded the error as

  '/New_drive/sambafiles' does not exist or permission denied when connecting to [Ohmi-New] Error was Permission denied

Can anyone suggest me the way to solve this problem?

share|improve this question
What are the permissions of /New_drive in the filesystem and does /New_drive/sambafiles exist? – James O'Gorman Dec 29 '11 at 21:16
James is correct in asking for the perms, what are the results of running ls -ld /New_drive/ /New_drive/sambafiles/. But on an off chance, is selinux running? What is the result of getenforce? – becomingwisest Dec 30 '11 at 0:33
@JamesO'Gorman thanx.. drwxrwxrwx 4 smbuser users 4.0K Jul 5 08:41 New_drive is the permission for the drive .. Of course i created '/New_drive/sambafiles' ssh via smbuser. – Bajib Dec 31 '11 at 8:52
@ChristopherEvans Thanks... i checked the permissions which looked like drwxrwxrwx 4 smbuser users 4096 Jul 5 08:41 /New_drive/ drwxrwxrwx 3 smbuser users 4096 Dec 30 05:02 /New_drive/sambafiles/ and the result of sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 21 Policy from config file: targeted – Bajib Dec 31 '11 at 9:00
@JamesO'Gorman thank you very much for the suggestion. I tried to run the command but the effort is in vain. When running semanage fcontext -a -t samba_share_t "/New_drive(/.*)?" the following error comes "apacheds homedir /var/lib/apacheds or its parent directory conflicts with a defined context in /etc/selinux/targeted/contexts/files/file_contexts, /usr/sbin/genhomedircon will not create a new context. This usually indicates an incorrectly defined system account. If it is a system account please make sure its login shell is /sbin/nologin. " – Bajib Jan 5 '12 at 19:41

It sounds like SELinux is blocking this.

The Fedora wiki entry has an entry on how to fix this. Essentially an extended attribute is needed for SELinux to allow non-default Samba shares.

chcon -t samba_share_t /New_drive
semanage fcontext -a -t samba_share_t "/New_drive(/.*)?"
restorecon -R -v /New_drive
share|improve this answer
thank you very much for the suggestion @JamesO'Gorman – Bajib Jan 5 '12 at 19:40

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.