[New Addon] Samba NAS. (Mount external disk and share it )

HI Lucio,

I’m interesting in mount my external share to be used with plex for Hassio… What you done with plex add-on?

You need to use my version of the plex addon (Plex Media Server with NAS
) to remount the exposed disk.

For example my sambanas config:

workgroup: WORKGROUP
username: ##########
password: **********
interface: ''
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
moredisks:
  - LIBRARY
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false
autodiscovery: {}

My Plex Media Server with NAS
config:

claim_code: claim-**********
webtools: true
networkdisks:
  - //192.168.0.250/LIBRARY
cifsusername: ##########
cifspassword: **************

NOTE: 192.168.0.250 is the address of my ha installation.

Hi Lucio, thank you for your answer. Yesterday night I found your version of plex add-on, but I’m not able to load my shares (I would like to load a disk shared by my fritz!box 7590). When I start the plex add-on I’ve all times in the log:

[00:17:45] INFO: Starting the Plex Media Server...
[00:17:45] INFO: Network Disks mounting.. //192.168.178.1/Elements4TB_ANIMAZIONE
//192.168.178.1/FILM_Elements2TB
[00:17:45] INFO: Mount //192.168.178.1/Elements4TB_ANIMAZIONE
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[00:17:45] INFO: Mount //192.168.178.1/FILM_Elements2TB
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[00:17:45] WARNING: Protection mode is ON. Unable to mount external drivers

Seems that username or password are not correct, but I doulbe checked and all is ok.

This is my configuration:

claim_code: claim-_mdRA4VpMY7UznzyYQXU
webtools: true
networkdisks:
  - //192.168.178.1/Elements4TB_ANIMAZIONE
  - //192.168.178.1/FILM_Elements2TB
cifsusername: gpaoli
cifspassword: *******
log_level: debug

But in plex under my shares nothing is showed.

Following what you are saying in your reply, did you use both your add-on in combo? Before you re-share your “libray” share whit sambanas and then you mount from plex add-on? Thank you for your help. Gianluca.

I suggest you to remove the claim_code from the box, request a new and invalidate the old.

What is your environment? (Rpi3, Rpi4, Odroid, Nuc etc etc).

Il look like the addon is unable to create the mounting dir or the shares are not visibles.

Your network is 192.168.178.0/24?
Fritz and Ha are on the same network?
The protection mode is off?

L.

I’ve a RPI4 with Hassio (the latest version released). My network is 192.168.178.x and my fritzbox ip is 192.168.178.1. Both fritz and Ha are in the same network (Ha is 192.168.178.10) and I disabled the protection, also if in log still the row that say the opposite…

How to invalidate the claim code that actually I’ve?

Nothing to do… also with a new claim code. What I don’t understand is why in log still the warning that protection mode is on, also if this setting is set to off…

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Plex Media Server with NAS
 Recorded media, live TV, online news, and podcasts ready to stream.
-----------------------------------------------------------
 Add-on version: 2.4.0-dht1
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.9  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2020.12.2
 Home Assistant Supervisor: 2020.12.7
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to DEBUG
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] plex.sh: executing... 
[cont-init.d] plex.sh: exited 0.
[cont-init.d] webtools.sh: executing... 
[cont-init.d] webtools.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22:28:56] INFO: Starting the Plex Media Server...
[22:28:56] INFO: Network Disks mounting.. //192.168.178.1/FRITZ
[22:28:56] INFO: Mount //192.168.178.1/FRITZ
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[22:28:56] WARNING: Protection mode is ON. Unable to mount external drivers!

Finally I found the problem… The path from linux system is not the same like on windows… I was trying to mount smb://192.168.178.1/xxx, while is smb://192.168.178.1/fritz.nas/xxx. Now I’m able to mount my shares! Thank you so much for this fantastic add-on! Just last question, how I can update the plex server? I’ve a notification , but it just let me download a file…

The Plax server is installed on an ephemeral disk so no update is possible without a rebuild of the docker image. I will release the next version in a near future…

L.

ok, thank you. Last question, Now I’m able to see my share, but when I try to play something after few second it stop. Looking in information plex says that is not accessible (permission) also if it see the file. Do you have an idea how to solve this? How I can set the right privileges to play video from plex?
Have a look to screnshots. Thank you in advance, Gianluca.

Is a new problem for me. If you see the movie you can read it so probably is a seek error or an re-encode error.
Any logs in the addon?
Have you made a search on Plex site about it?
Do you used Fritz as server before for Plex?

Is is enabled try to change o disable the re-encoding.

L.

In plex web site is reported that plex need to have permission to handle files and normally the user assumed to do this is “plex”. How I can figure out what kind of user is used here? I think that is something related to this.
I’ll try also your suggestion to enable or disable reencoding.

No info in the log file of addon that actually is set to debug.

Before I used the internal feature of fritz box to share like a Nas files, but is not very good. All files are stored in 2 usb disks (ntfs formatted) attached and shared from fritz.

Lucio,

this is the stamp of log in trace mode:

[services.d] starting services
[services.d] done.
[10:22:53] INFO: Starting the Plex Media Server...
[10:22:53] TRACE: bashio::config.has_value: networkdisks
[10:22:53] TRACE: bashio::config: networkdisks
[10:22:53] TRACE: bashio::jq: /data/options.json if (.networkdisks == null) then
            null
        elif (.networkdisks | type == "string") then
            .networkdisks // empty
        elif (.networkdisks | type == "boolean") then
            .networkdisks // false
        elif (.networkdisks | type == "array") then
            if (.networkdisks == []) then
                empty
            else
                .networkdisks[]
            end
        elif (.networkdisks | type == "object") then
            if (.networkdisks == {}) then
                empty
            else
                .networkdisks
            end
        else
            .networkdisks
        end
[10:22:53] TRACE: bashio::var.has_value: //192.168.178.1/fritz.nas/Elements4TB_ANIMAZIONE
//192.168.178.1/fritz.nas/FILM_Elements2TB
[10:22:53] TRACE: bashio::config: networkdisks
[10:22:53] TRACE: bashio::jq: /data/options.json if (.networkdisks == null) then
            null
        elif (.networkdisks | type == "string") then
            .networkdisks // empty
        elif (.networkdisks | type == "boolean") then
            .networkdisks // false
        elif (.networkdisks | type == "array") then
            if (.networkdisks == []) then
                empty
            else
                .networkdisks[]
            end
        elif (.networkdisks | type == "object") then
            if (.networkdisks == {}) then
                empty
            else
                .networkdisks
            end
        else
            .networkdisks
        end
[10:22:53] TRACE: bashio::config: cifsusername
[10:22:53] TRACE: bashio::jq: /data/options.json if (.cifsusername == null) then
            null
        elif (.cifsusername | type == "string") then
            .cifsusername // empty
        elif (.cifsusername | type == "boolean") then
            .cifsusername // false
        elif (.cifsusername | type == "array") then
            if (.cifsusername == []) then
                empty
            else
                .cifsusername[]
            end
        elif (.cifsusername | type == "object") then
            if (.cifsusername == {}) then
                empty
            else
                .cifsusername
            end
        else
            .cifsusername
        end
[10:22:53] TRACE: bashio::config: cifspassword
[10:22:53] TRACE: bashio::jq: /data/options.json if (.cifspassword == null) then
            null
        elif (.cifspassword | type == "string") then
            .cifspassword // empty
        elif (.cifspassword | type == "boolean") then
            .cifspassword // false
        elif (.cifspassword | type == "array") then
            if (.cifspassword == []) then
                empty
            else
                .cifspassword[]
            end
        elif (.cifspassword | type == "object") then
            if (.cifspassword == {}) then
                empty
            else
                .cifspassword
            end
        else
            .cifspassword
        end
[10:22:53] INFO: Network Disks mounting.. //192.168.178.1/fritz.nas/Elements4TB_ANIMAZIONE
//192.168.178.1/fritz.nas/FILM_Elements2TB
[10:22:53] INFO: Mount //192.168.178.1/fritz.nas/Elements4TB_ANIMAZIONE
[10:22:53] INFO: Success!
[10:22:53] INFO: Mount //192.168.178.1/fritz.nas/FILM_Elements2TB
[10:22:53] INFO: Success!

But , where really those dnetwork share are mounted in hassio file system? My doubt is regarding the ability of plex to read from a “physical” location where all rights are set. Let me know, and excuse me about “linux/unix” doubt but I’m a novice in this. Thanks.

Hi Lucio, some updates from my side… I can tell you that my “permission” problem is coming from shares made from Fritz!box that seems to not give “read/write” access to the hassio add-on. The same share takes from Mac or Windows can be used without problem, but not with linux: I tested in Ubuntu e mounted with smb protocol, and using a new installation (on Ubuntu) of PLEX, I’ve the same behavior. Now I’m investigating on this… however, testing the same USB disk that I’m using on Fritz!box, and sharing this from my Mac, I’m able to read normally trought your add-on in hassio.
Now I need to understand why, because I need to maintain those disks mounted in a fixed position in my house, and the Fritz!box is the most good choice.
Mounting directly thhis USB on the raspberry, you think will be feasible and visible from the plex add-on?

Yes and no. The problem is the ntfs that is not fully supported. In my config I use an usb on raspberry shared with sambanas and remount in plex on the same rpi. The fs is ext4.

L

Is it possible to chose which folders are exposed? I would like to not share /config

The base is the official samba share addon so no.
Open an issue in the GitHub repository I will try to implement in next releases

Ok Lucio, is however a combination between fritzbox “shares” support ad maybe NTFS, I also make a test formatting a new disk in ext4, attach to the fritzbox and try to mount directly with your plex addon. Result the same that I’ve with NTFS drive (permission problem). The usb drive format in EXT managed with sambanas and then mount with your addon (usb disk directly attached to the raspberry) works fine! At this point I’ve to choices, format my drives (3 and 4TB full of movies) in EXT or wait for your future implementations of addons implementing NTFS :grin:! Thanks a lot for your work!

Use the ext4 fs. The linux kernel rw support for NTFS is planned “till the cows come home”.

The only support for NTFS is with fuse drivers and samba has a lot of issue with it.

Ref: https://www.phoronix.com/scan.php?page=news_item&px=Paragon-Read-Write-NTFS-Linux

L.

:rofl: :+1:

I installed this today to use a USB drive I’ve had on the network instead of on my PC. It works except that the NTFS partition shows up as read only. The smaller Linux partition is writeable.

I’ve seen that NTFS will be slow which is OK for now, and I realy don’t want to try to move all the files from there to something else to reformat the partition.

Any chance NTFS will be writeable at some point?
Thanks,