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

Great add-on Lucio, congratulations. I configured it on my raspberry pi 3 and everything was great for a couple of weeks: I was able to expose two partitions on my HDD, one exFAT formatted and the other one EXT4 formatted. I was even able to use the EXT4 formatted one for TimeMachine back-ups several times (I had some issues over that but nothing that a SAMBANAS restart could not solve).

I started having problems 3-4 days ago, when I went back home and found my Home Assistant completely stuck (while nobody was home using the exposed folders/partitions and only months-old automations were running). I was not even able to solve by manually rebooting the raspberry, since during the starting process the system got stuck again repeatedly (not even unplugging the external HDD). I was finally able to boot by stopping the auto-start of the SAMBANASS add-on. Then I tried to manually boot it again WITHOUT attaching the external HDD but no solution, after some seconds the system got stuck again with a manual reboot being the only possible solution. Today I tried again without the external HDD. In the few minutes before going to work everything was working properly for some minutes but then everything got stuck again and the only solution was a manual reboot.
Since the problem was there also when the HDD was not plugged-in, the only thing that came to my mind was the system over heating, does it make sense? Unluckily I didn’t check the raspberry CPU temperature when the problem happened for the first time, today it was around 62-63 °C when it got stuck (so higher than the 53-55°C i get when the addon is not running but still lower than the temperatures I reach in summertime). Is my raspberry 3 too old/are raspberry systems not powerful enough for such duties?

I’m sending you also my addon configuration file even if I don’t feel it being useful.

workgroup: xxx
username: xxx
allow_hosts:

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16
  • fe80::/10
    automount: false
    moredisks:
  • EXT4PARTITIONNAME
  • exFATPARTITIONNAME
    available_disks_log: true
    medialibrary:
    enable: false
    veto_files:
  • ._*
  • .DS_Store
  • Thumbs.db
  • icon?
  • .Trashes
    compatibility_mode: false
    wsdd2: false
    mqtt_use_legacy_entities: false
    autodiscovery: {}
    other_users: []
    acl:
  • share: EXT4PARTITIONNAME
    timemachine: true
    interfaces: []
    password: xxx

Hi
Does the addon work properly on HA OS 10.0?

Maybe this is a stupid question, but I’m a bit lost – What I’m trying to do is have my 4tb drive mounted in Samba NAS (which I have working), and now I’m trying to use Jellyfin Server (GitHub - mdvorak/ha-addon-jellyfin: Home Assistant add-on for Jellyfin Server), however I can’t find the external drive.

My understanding is that if I change medialibrary to true, that will expose that drive to the Jellyfin Server addon? If so, how can I set up an ssh key to access it? I tried just medialibrary to enable: true without an ssh key and got this error.

Blockquote [12:45:18] WARNING: SSH Private Key Host not found!
[12:45:18] WARNING:
[12:45:18] WARNING: A recommended add-on configuration option is not set.
[12:45:18] WARNING:
[12:45:18] WARNING: The configuration key ‘ssh_private_key’ seems to be empty.
[12:45:18] WARNING:
[12:45:18] WARNING:
[12:45:18] WARNING: Consider configuring this because:
[12:45:18] WARNING: SSH Private Key is required for enable medialibrary
[12:45:18] WARNING: Check the add-on manual for more information.
[12:45:18] WARNING:
/etc/s6-overlay/s6-rc.d/init-automount/run: line 148: bashio::log.waring: command not found
s6-rc: warning: unable to start service init-automount: command exited 127
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.

I’m familiar with Samba and how it works, but I just assumed when the 4tb drive automounted to be used for samba that it would have mounted it to a place accessible by home assistant addons. I also read through the configuration but I didn’t find anything that was helpful.

My SambaNAS from time to time loose its folders. The shared disk is visible from WIN but without subfolders. No problems in the log. An add-on restart does restore subfolders.
Anyone else do have this problem as well?
Any solution?

Hi
I’m not able to start SambaNAS on my new Home Assistant installation.
In the logs is following error:

Load key "/root/.ssh/id_rsa": error in libcrypto
[email protected]: Permission denied (publickey).
s6-rc: warning: unable to start service init-automount: command exited 128
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up!

On my previous HA installation it worked without any isues.
It’s the same machine (NUC), just a new installation of HA. SSH on Port 22222 is enabled.

Does anyone know how I can get it working without restoring a backup?
I don’t want to restore any backup because I had a bug in my previous HA installation which caused random restarts of the system (3-4 times per day).

Many thanks in advance :slight_smile:

In a few hours Home Assistant 2023.6 will be available which includes this feature natively:

That’s great news, thanks :slight_smile:

Unfortunately the new feature of 2023.6 is only for network drives.
It’s not mounting USB disk.

So there is still the same question to me:
Does anyone know how I can get the addon working without restoring a backup?

It is for USB storage as well…
image
… but I was unable to make it work. Maybe because for me Samba NAS needs frequent restarts to operate. At least in my case. I started with a new backup destination yesterday and found no morning backup today, so the tests were short so far, but stilll… at this moment not working.

Great Addon.
Would it be possible to allow it to mount as nfs shares as well?

Hi there, thanks for the amazing addon! Where can I find some docs re: how to configure ACLs? (or can you provide some simple example? i.e. how to allow some users RW access to a share/subfolder while having everyone else RO access or no access at all?

I use it and get the error message as shown


Looks like it doesn’t support Debian GNU/Linux 11 (bullseye)

Hi! Same problem here:

-----------------------------------------------------------
 Add-on: Samba NAS
 Expose Home Assistant disc with SMB/CIFS
-----------------------------------------------------------
 Add-on version: 10.0.2-nas4
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / odroid-c2)
 Home Assistant Core: 2023.6.1
 Home Assistant Supervisor: 2023.08.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-automount: starting
[00:21:01] WARNING: Your operating system Debian GNU/Linux 11 (bullseye) is not supported! 
+------------------------------------------------------------------+
| THIS ADDON IS DESIGNED FOR HOME ASSISTANT OPERATING SYSTEM ONLY! |
| THIS ADDON IS DESIGNED FOR HOME ASSISTANT OPERATING SYSTEM ONLY! |
| THIS ADDON IS DESIGNED FOR HOME ASSISTANT OPERATING SYSTEM ONLY! |
| THIS ADDON IS DESIGNED FOR HOME ASSISTANT OPERATING SYSTEM ONLY! |
| THIS ADDON IS DESIGNED FOR HOME ASSISTANT OPERATING SYSTEM ONLY! |
+------------------------------------------------------------------+
[00:21:02] FATAL: You can force this addon to run only if you known the meaning of life!
s6-rc: warning: unable to start service init-automount: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

How can I expose an additional folder on the native drive? Ive added hassos-data to expose the entire drive but id like to only expose a folder within that drive.

Dear Lucio,

thank you for this great add-on. I read through all the documentation and was able to setup Samba including a full-working Time Machine Backup onto the 2nd internal SSD within ~30 mins. Plus dedicated user and ACL setup, of course. :wink:

Cheers!

Hello
Thanks for this great add on, I use my HA as a NAS. in this frame I would like to know if there is any possibility to manage external Hud hibernation?

With Debian we can use hdparm , hdidle but with HASSIO I don t know?
I m on hp prodesk 600 g3 with hassio

Thanks

unfortunately disk power feature is not standard and depends on the brand.
You can try to set the idle option. If your disk support SATA2 commands should work.

option-hdd_idle_seconds

Hi
Thanks for the info, I try
After restart, hdd is well spin down 5 mn after restart, some minute later he’d restart and never spind down anymore!
Any idea?
Thanks

There are 3 possible reasons:

  • There is a process that do read on the device ( check clients that are mount a share on the disk )
  • There is a bug somewhere and the idle process dead for some reason.
  • There is a bug in the MQTT report daemon. Try to disable MQTT reporting in the addon.

Can you open a bug in github Link with the log from startup until the last spin up?

L.

Hello, im very new, so im sorry.
I installed Samba NAS and attached my USB HardDrive to the PI.
The Drive is located in HA under System. I start Samba NAS but cant access my Drive via Explorer and IP.
Can u help?