$title =

ZFS Pool Samba Share

;

$content = [

One of my needs is to serve up a fileshare that can be used for media and accessible by a future Jellyfin install.

Doing a little bit of reading about others’ experiences, I decided to run samba directly on the Proxmox host rather than virtualizing. Mainly, it is just simpler. There are certainly risks to installing and running things on the host, since its job is to run everything else. You risk messing something up and causing an issue to the parent system. But samba seemed reasonably low risk, so I decided to go ahead and run with it.

Create ZFS Pool

I had three 1TB drives that I wanted to dedicate to this shared storage. Going to Datacenter -> Node -> Disks -> ZFS you can create a ZFS pool. Note that the disks must first be initialized with GPT before they can be used (this is done in the parent Disks screen).

I went with RAIDZ a.k.a RAIDZ1 which provides failure tolerance for 1 of the 3 drives. This reduces the max storage from a total of 3TB to ~2TB. Click Create ZFS and name the pool, set your RAID level, and create:

Samba Config

Now samba can be installed and configured.

apt update 
apt install samba 

Once complete, we can check the mountpoint of the new pool. After creation it should be mounted in / by default.

zfs get mountpoint

Now we create a unix user that will have limited access to the mountpoint so we can use it to log in from other machines.

adduser [your new user]

Create a group to give the samba privs to. In this case I just named it smbgroup.

groupadd smbgroup

Then add the user to the group.

usermod -aG smbgroup [your new user] 

Now we can edit the samba config to include our new mountpoint.

nano /etc/samba/smb.conf

And paste a config at the end defining the share:

[zfs-datastore-01]                                                                                                                                                                                                                                                                                                                                                      
   path = /zfs-datastore-01                                                                                                                                                                                                                                                                                                                                             
   browseable = yes                                                                                                                                                                                                                                                                                                                                                     
   writable = yes                                                                                                                                                                                                                                                                                                                                                       
   guest ok = no                                                                                                                                                                                                                                                                                                                                                        
   valid users = @smbgroup                                                                                                                                                                                                                                                                                                                                              

We need to make the new user a samba user. Run smbpasswd -a to add the user, then -e to enable it. the -a flag will ask you to set a password.

smbpasswd -a [your new user] 

smbpasswd -e [your new user]   

Finally, we can restart samba

systemctl restart smbd

systemctl enable smbd

Once complete, you should be able to access this share from another machine using the new user and password you created. You may have to manage firewall rules depending on your config. I accessed my share on a windows machine. The path should be:

\\[hostname/ip]\share name.

In my case, that was \\192.168.1.130\zfs-datastore-01

];

$date =

;

$category =

;

$author =

;

$next =

;