USB HDD write access using Samba from macos

  • Hi, New to forum and to LibreELEC. I have a RPI 3 running Libreelec/Kodi with a 1TB USB HDD (named Altair) with movies & music connected to RPI. RPI is networked via wifi & I can SSH into LIBRELEC. I have attempted to setup a samba.conf file to be able see and read/write to USB Drive from my mac over my network. I can see RPI from macos finder and can see USB drive. I can't seem to write to the USB drive, however, to drop new movies over the network. Listing of samba.conf file below. Request help to configure LibreELEC to allow read/write from mac finder. Here is cut & paste from SSH screen showing samba.conf file sitting in .config directory (used mac terminal program):

    Kodi:~/.config # ls -al
    total 64
    drwxr-xr-x 13 root root 4096 Nov 21 12:46 .
    drwxrwxr-x 15 1000 1000 4096 Nov 21 12:56 ..
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 aacs
    -rw-r--r-- 1 root root 284 Jun 22 11:58 hosts.conf
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 hwdb.d
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 modprobe.d
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 modules-load.d
    drwx------ 2 root root 4096 Jun 22 11:58 pulse
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 pulse-daemon.conf.d
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 rc_keymaps
    -rw-r--r-- 1 root root 895 Nov 21 13:25 samba.conf
    -rw-r--r-- 1 root root 4030 Jun 22 11:58 samba.conf.sample
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 sysctl.d
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 system.d
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 tmpfiles.d
    drwxr-xr-x 2 root root 4096 Jun 22 11:58 udev.rules.d
    Kodi:~/.config # cat samba.conf
    [global]
    server string = LibreELEC
    workgroup = WORKGROUP
    netbios name = %h
    security = share
    guest account = root
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
    smb ports = 445
    max protocol = SMB2
    min receivefile size = 16384
    deadtime = 30
    os level = 20
    mangled names = no
    syslog only = yes
    syslog = 2
    name resolve order = lmhosts wins bcast host
    preferred master = yes
    domain master = yes
    local master = yes
    printcap name = /dev/null
    load printers = no
    browseable = yes
    writeable = yes
    printable = no
    encrypt passwords = true
    enable core files = no
    passdb backend = smbpasswd
    smb encrypt = disabled
    use sendfile = yes

    [storage]
    path = /storage
    available = yes
    browsable = yes
    public = yes
    writable = yes

    [Altair]
    path = /Altair
    available = yes
    browsable = yes
    public = yes
    writable = yes
    Kodi:~/.config #

  • If the USB drive is HFS+ formatted for macOS it will mount read-only under Linux. There are several ways to deal with this, but the least complicated option is to move all data off the drive, reformat it using exFAT instead of HFS+, then copy data back.

  • Perhaps I'm totally off the track, but isn't the actual problem that Colokid does not point to the mountpoint of the drive? How could samba know where to find the disk by only giving

    Code
    [Altair]
      path = /Altair

    what would be if you try?:

    Code
    [Altair]
    path = /media

    This should list all mounted drives. If you see then the name of the drive, then you can add it to specify the mount point one level deeper:

    Code
    [Altair]
    path = /media/**HDDName**


    So I guess it's:
    path = /media/altair
    or
    path = /media/Altair
    (case sensitive!)

    Edited once, last by infinity85 (November 23, 2016 at 7:00 PM).

  • Hi all. infinity85's approach above did not work (I tried) but using an exFAT formatted HDD with a Master Book Record (vice GUID) did work! I was able to remotely create a folder and drop a movie file into it from the Finder on Mac using my home network. Very slow but it did work (going over wifi as network connection, likely much faster via cabled Ethernet).

    Thanks all for helping a newbie here.

    Cheers, ColoKid

  • Oh I was pretty surprised reading that. But after further testing I see that /Altair and /media/Altair is handled the same way, apparently :). I'm glad it works now for you!

    Regarding the very slow transfer: Try deleting the values SO_RCVBUF=65536 SO_SNDBUF=65536
    This doubles (or even more) the samba transfer speed on my Odroid C2 (before 13MB/s, after up to 40MB/s). Not sure which effect it can have on RPi3. Of course the wifi connection can be the limit already, so removing those buffers won't have any positive effect.

    Edited once, last by infinity85 (November 23, 2016 at 8:46 PM).


  • Oh I was pretty surprised reading that. But after further testing I see that /Altair and /media/Altair is handled the same way, apparently :). I'm glad it works now for you!

    Regarding the very slow transfer: Try deleting the values SO_RCVBUF=65536 SO_SNDBUF=65536
    This doubles (or even more) the samba transfer speed on my Odroid C2 (before 13MB/s, after up to 40MB/s). Not sure which effect it can have on RPi3. Of course the wifi connection can be the limit already, so removing those buffers won't have any positive effect.

    I think the samba.conf might be a red herring (in that it's not required) anyway.
    I have a 5TB drive on my s905 box and the nearest entry I have in samba.conf is:

    Code
    [USB Drives]
      path = /media
      available = yes
      browsable = yes
      public = yes
      writable = yes
      root preexec = mkdir -p /media


    - but it shows up by name and behaves nicely anyway when I view shares - presumably as long as you've checked 'share external drives automatically' (or something close to that) in libreelec settings.