Cockpit/Houston ZFS pools using Samba and NFS

Has anyone experienced this issue with getting Samba running using a directory within a ZFS pool?

I am getting this error:

systemctl status smb.service
● smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2023-11-30 14:16:35 CST; 9s ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Process: 97862 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=1/FAILURE)
Main PID: 97862 (code=exited, status=1/FAILURE)

Nov 30 14:16:35 hl15 systemd[1]: Starting Samba SMB Daemon…
Nov 30 14:16:35 hl15 smbd[97862]: [2023/11/30 14:16:35.559191, 0] …/…/source3/smbd/server.c:1746(main)
Nov 30 14:16:35 hl15 smbd[97862]: smbd version 4.18.6 started.
Nov 30 14:16:35 hl15 smbd[97862]: Copyright Andrew Tridgell and the Samba Team 1992-2023
Nov 30 14:16:35 hl15 systemd[1]: smb.service: Main process exited, code=exited, status=1/FAILURE
Nov 30 14:16:35 hl15 systemd[1]: smb.service: Failed with result ‘exit-code’.
Nov 30 14:16:35 hl15 systemd[1]: Failed to start Samba SMB Daemon.

Initially I started with creating a Samba share using the path /zfsPoolName/smbDirectory. The directory as a specific user (called prtsvc) to have access to this directory via user and group. I did set a password for the user via Identity and I created a samba password as well.

Initially the samba share seems to work this way, but I was never able to successful connect via username/password. I did check what the SAMBA workgroup name was. Initially it was SAMBA. I tried that but it did not work. I changed it to HL15 but that did not work either.

Therefore I went over to the ZFS section, navigated to the specific folder, and used the “Configure Samba” option (I click on browseable and restart samba service). I did see this type of change made larger changes to the smb.conf. The service was running but I was still not able to connect.

As a last effort I type systemctl restart smb.service which gave this error message.

And to just give extra info, the files on the ZFS pool are good. I did a checksum on random files and everything is working.

For the time being, I have paused the user of Samba (as I had only two directories shared).

I am configuring the NFS shares for my Proxmox cluster to reconnect (as the pool was moved from Truenas to this hl-15).

2023-11-30T22:45:00Z
I have successful configured NFS, connected my Proxmox cluster to the HL-15 NFS shares, and access the same NFS shares from my main laptop/desktop. I found a couple web links which I will post/update tomorrow.

2023-12-01T21:20:00Z
I have a list of item a new HL-15 prebuilt instance will need to be modify to successfully get Samba working. There are a number of changes needed. I will post a reply with those steps (after the weekend).

1 Like

Here is the workflow or the steps that I had to perform to get both NFS and SAMBA working. As I am not an avid user of Rocky Linux, this detail might be more than anyone would need. Here is a high level overview

  • set root passwd
  • using the IPMI remote console, I logged in as the 45drives user
  • using the utilities within the xfce environment
  • click on upper left dropdown “Applications - Settings - Advance Network Configuration”
  • within Network Connections, I updated Wired Connection 1 to use “Automatic (DHCP)” within the IPv4 Settings. Saved the setting.
  • HL-15 should have an ip address
  • Open terminal to set the root passwd.

At this point I noticed cockpit was not running and I shifted to a terminal window to do the next commands as root.

I turned off firewalld using

systemctl stop firewalld.

I disabled the firewalld service via

systemctl disable firwalld.

To enable cockpit, I used the command

systemctl enable --now cockpit.socket

At this point I have cockpit/houston running. I used the Web UI .

Using the Houston UI left navigation pane, I clicked on “Networking” to see that virb0 was set to 192...* address. I decided to update the vrbr0 Bridge to use eno1 and eno2. vrbr0 uses DHCP to get the IP Address.

I noticed that dnf update had some issues which forced me to clean/rebuild the cache. I used these commands:

dnf clean all && dnf makecache && dnf update

Dnf clean- this removes all metadata and cache of previous repo data

Dnf makecahce – this recreates the caching of the repos that were previously removed

Dnf update- updates the server. You may be prompted to type Y or N to apply the updates.

For my initial update, I had 26 new Packages to install and 426 packages to update.

After the system was update, I rebooted the system to confirm everything is in working order.

As I had my old Truenas drives exported, I open the HL-15 to allow me to insert the drives into 12 of the 15 slots. As these drives are “new” to the HL-15, I was able to insert them with the HL-15 running.

Using the Houston UI left navigation pane, I click on 45Drives Disk to confirm the 12 hard drives are shown.
Using the left navigation pane, I clicked on ZFS to select the upper right option “Import Storage Pool”. The web UI recognized the existing ZFS pool from the 12 drives. I accepted the defaults options “Mount file systems” and “SELinux Context for Samba”.

NOTE:  I would recommend to not select the option "SELinux Context for Samba" as this was the crux of my issue with getting Samba working.

Using the Houston UI, I click within the Identities section to add 6 more user accounts (and groups) that I used from my TrueNas environment.
Using the terminal prompt as root, I assigned the user/group premissions via chown and used chmod to make sure the Samba directory shares have a minimum directory permissions of 770 via

chown 770

Within the File Sharing - NFS section, I added the values for Path and Share Path. Under the client section, I have the 192.200.200.0/24 with the settings “sec=sys,rw,crossmnt,no_subtree_check,no_root_squash”

NOTE: I used a /24 CIDR rather than using specific IP address for each client that needs to connect. To be more secure you may want to give each ip address.

Once I have the NFS shared defined and saved, I verified connect using my desktop.

To configured the Samba share, I had to go back and make a few modifications within the Configure Cockpit ZFS Manager (upper right button next to “Refresh”. There is an image at the 20th reply on this thread.. I disabled “Mnaage Samba share” and “Display boot storage pool”. Click the blue “configure” button will save the changes.

After these Cockpit changes for the ZFS Manager, you should be able to make samba changes with many issues.

If you had previous attempted to configure Samba with those Cockpit ZFS settings, then you want to edit the /etc/samba/smb.conf to remove the include that was added by the Cockpit ZFS manager.

to confirm your Samba settings, you can use the command

testparms -s

The results of this command will give you the current globals as well as any share you have configured via the UI.

I did add “server min protocol = SMB2” within my global configuration. I will need to test if this is needed.

For me the Samba share allows my printer to save scanned documents to a network folder (and post any faxes I received to a digital format on the same folder).

Hope this helps others. I had a number of issues

There are some good articles on the 45drives knowledge space too:
KB450282 – Managing NFS in Houston UI
KB450281 – Managing SMB in Houston UI

4 Likes