Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Unhappy Samba share from mounted disk impossible.


    I have an asus X720D laptop I want to use as a little samba fileserver. This laptop is equipped with 2 (two) 500 GB drives. everything is ext4 formatted.
    First drive (sda) contains /home directory and all the systems subdirectories
    Second drive (sdb) contains a single big 500 GB partition mounted in one single directory (/mnt/data)
    -> here is the mount graph :
    (will PM you on demand for I need 15 posts to paste http links)
    everything works perfectly on internal access from the laptop.

    I want to share both homes directories for windows users AND this /mnt/data directory-drive-partition for windows users inside my little network (192.168.1.XX) and workgroup.

    This works perfectly for all shares (home, printers and printing, pdf generator) but definitely refuses to work for the mounted sdb drive. All attempts give an access denied from windows client.

    Yes, I HAVE checked rights and permissions for /mnt/data (and set it to 0777 so that it SHOULD work).

    I belive there must be a problem from Samba refusing to serve mounted partitions, or a mount option mistake somewhere, which does not give a visible (for me) error in log.smbd but I may not have investigated intensively this log file.

    My system is OpenSuse 11.4, perfectly fine tuned and running. Accessing /mnt/data from laptop is working.

    here is my smb.conf file:

    (will PM you on demand for I need 15 posts to paste http links)
    here is my fstab file:
    /dev/disk/by-id/ata-ST9500325AS_6VEDPJ0G-part6 swap                 swap       defaults              0 0
    /dev/disk/by-id/ata-ST9500325AS_6VEDPJ0G-part7 /                    ext4       acl,user_xattr        1 1
    /dev/disk/by-id/ata-ST9500325AS_6VEDPJ0G-part5 /home                ext4       defaults              1 2
    /dev/disk/by-id/ata-ST9500325AS_6VEDMC5Y-part1 /mnt/data            ext4       defaults              1 2
    /dev/disk/by-id/ata-ST9500325AS_6VEDPJ0G-part2 /mnt/windows/C       ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=fr_FR.UTF-8 0 0
    proc                 /proc                proc       defaults              0 0
    sysfs                /sys                 sysfs      noauto                0 0
    debugfs              /sys/kernel/debug    debugfs    noauto                0 0
    usbfs                /proc/bus/usb        usbfs      noauto                0 0
    devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
    does a mount option from fstab prevents or allow file sharing from a mounted disk ? this is the question.

    How can I correct this.

    All other shares from (sda) are possible with no problems at all which suggests me there may be a mount option problem

    here are in french mout options for (sdb)
    (will PM you on demand for I need 15 posts to paste http links)
    Attached Images Attached Images

  2. #2
    I typically work with Red Hat & Fedora, so I'm not sure if OpenSuse uses SELinux or not. A web search seemed to indicate that it would be included starting version 11. At any rate, this sounds like it could be an SELinux issue. Here's a quick way to test. Run:
    # setenforce 0
    This command will put SELinux into permissive mode. Essentially it won't stop anything that would typically be stopped based on the SELinux policy. If you get an error related to the command not being found, then SELinux probably isn't installed. If it comes back without an error, try accessing your samba share again. If it works this time, then you definitely have an SELinux issue. You'll need to let SELinux know that this is a directory that can be shared via samba. You might look at the man page for samba_selinux, but essentially here's what you need to do.

    Add rules for your directories:
    # semanage fcontext -a -t samba_share_t '/mnt/data(/.*)?'
    # semanage fcontext -a -t samba_share_t '/mnt/windows(/.*)?'

    Restore the context of your directories based on these new rules:
    # restorecon -vvRF /mnt

    Put SELinux back into enforcing mode (setenforce 1) and then test again.


  3. #3

    Thank you for your answer, please forgive my late response.

    Your solution is worth being tried, I have begun installing SElinux on my SUSE, but cannot find semanage utility, do you know what packages does it belong to ?


  4. $spacer_open
  5. #4
    sorry, finally found package :

    now trying

    Here is the result it gives :

    semanage fcontext -a -t samba_share_t '/mnt/data(/.*)?'
    /usr/sbin/semanage: SELinux policy is not managed or store cannot be accessed.
    although /mnt/data is accessible on file manager

    but setenforce 0 or 1 states that SElinux is disabled.

    How to enable all this ??
    Last edited by tofm2; 09-26-2011 at 01:21 PM.

  6. #5
    SELinux can be enabled by modifying /etc/sysconfig/selinux. There are only two lines in that file that haven't been commented out, and one of them is likely to say SELINUX=disabled
    You could change this line to say SELINUX=enforcing and then reboot. To go from disabled to enforcing requires a reboot... and it will relabel your entire system... which could take a while.

    CAUTION: Since SELinux is disabled, the problem that you're having isn't an SELinux problem! Enabling SELinux probably won't solve your problem and it may even cause additional problems for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts