Help configurig PVE and Turnkey fileserver to share ZFS pool

Psilospiral

Member
Jun 25, 2019
38
10
13
52
Seeking help configuring PVE 5.1-11 running on a R720xd to allow Turnkey Linux fileserver to share a ZFS pool created from within PVE CLI.

Problem: Turnkey appears to share its local CT drive, not the ZFS pool created on the R720xd.

Steps taken:
Created a ZFS pool r720xd1 using 4x 3 TiB SAS drives mounted in the R720xd and created storage directory:

Code:
zpool create r720xd1 raidz2 -f /dev/sda /dev/sdb /dev/sdc /dev/sdd
zfs set compress=on r720xd1
zfs create r720xd1/storage
zfs list
   5.25T AVAIL

Datacenter>Storage>Add>ZFS and entered:
ID: zfs-storage
ZFS Pool: r720xd1/storage
Content: Disk image, Container
Enable: Check
Thin provision: Check
Add

NOTE: In Datacenter>Storage> I now see zfs-storage, but under "Shared" is stated "No"... tingling sensation...

Datacenter>Create CT
Hostname: fileserver-ct
Unprivileged: Uncheck
Root Disk>Disk size (GiB): 8
Network>Firewall: Unchecked
Finish
Status: stopped: OK

Datacenter>r720xd1(node name)>fileserver-ct>Resources>Add Mountpoint
Storage: zfs-storage
Disk size (GiB): 5200
Path: /storage
Create

Datacenter>r720xd1(node name)>fileserver-ct>Options>Features>Edit
NFS: Check
CIFS: Check

Start the CT
Login as root
Create Root Samba Password
Install security updates

On a host machine on the same LAN:
https://192.168.1.186:12321
Dashboard reports: Local Disk Space: 1.47 GB used / 5.08TB free / 5.09 TB total

So based on this, I would believe I am utilizing the zfs-storage created above with 4x 3 TiB SAS drives configured in raidz2. (Due to the 5.09 TB reported in Webmin and 5.25 TB reported with zfs list). However, when I try to copy a 6 GiB file to the share, the host OS reports there is not enough free space. This leads me to believe the share is actually using the CT Root Disk size of 8 GiB instead of my zfs-storage raidz2 of 5 TiB....

What am I doing wrong to share the zfs-storage?
 
  • Like
Reactions: semanticbeeng
I wanted to post the two solutions I found and then ask the forum for opinions on the best solution.

After creating the Turnkey File Server CT, go to its shell and enter
Code:
mount --bind /mnt/storage /srv/storage

Go to a client on the LAN, navigate to the server's IP address, login to WebDAV, and note that now the available storage space matches that of the host ZFS pool instead of Turnkey's /srv/storage path. This method bind mounts the local PVE /mnt/storage path with Turnkey File Server's default storage path of /srv/storage . It would also require the CT's /etc/fstab to be edited with:
Code:
/mnt/storage /srv/storage none defaults,bind 0 0
in order to survive a reboot.

The second solution is a correction to my original path entry:
Code:
Datacenter>[your node name]>[your Turnkey File Server CT Name]>Add>Mount Point
Mount Point ID: default
Storage: [select your local ZFS pool]
Disk size (GiB): [convert your ZFS pool's available TiB to GiB and enter here]
Path: /srv/storage
Create

In my original post, my path is incorrectly set to /storage instead of /srv/storage ! By adding a mount point to the CT from within PVE WebUI that matches Turnkey File Server's default storage path of /srv/storage , Turnkey File Server then utilizes the local ZFS storage pool on the PVE host.

Are there any advantages or disadvantages to either of these two methods???
 
Hi did you figure out the pros and cons of the two methods? Which one did you use? I'm trying to follow your steps on the proxmox ve 6.2-11. The first bind mount method does not work. It says /mnt/storage no such file or directory... The second method works, but I found that the samba shared files are in a subvol-114-disk-0 folder in the zfs pool. But I want to access all the contents in the zfs pool. This method is not for me since...
 
Hello prolab:

I tried several different CLI methods before I realized the PVE GUI method was the easiest and best solution for me. To mount a Turnkey Linux File Server CT within Proxmox:

After creating the TKLFS CT, go to Datacenter>[node name]>[TKLFS CT]>Resources>Add>Mount Point.

Mount Point ID: accept default number
Storage: select your ZFS pool name created within PVE CLI
Disk size (GiB): convert the TiB of your ZFS pool size to GiB
Path: /srv/storage

The path is the trick here. PVE's mount point must match that of TKLFS's default path to its storage path (/srv/storage).

In my setup, my CIFS path does not include the subvol. When I create a new share, it is accessible via //10.0.2.10/[TKLFS share name] without the 'subvol' within path.

However, if I want to access the storage path from within the PVE command line, it is:

/[ZFS pool name]/[container subvolume]/[TKLFS share name]

In my case, my zfs pool name is r720xd1, and my TKLFS container CT number is 101. So if I want to navigate to a 'music' share path from within PVE, I would use:

cd /r720xd1/subvol-101-disk-0/music

From within the TKLFS CT the equivalent path is:
/srv/storage/music

Within a Windows machine on the same network, I go to
\\[TKLFS IP address\[TKLFS share name]

Such as:
\\10.0.2.10\music

Within a Linux machine on the same network, I nano /etc/fstab and enter:
Code:
//10.0.2.10/storage /mnt/storage cifs credentials=/home/[user]/.credentials,noperm rw 0 0

And for the file /home/[user]/.credentials - its content is:

Code:
username=[TKLFS user name with access to the share]
password=[TKLFS password for user name with access to the share]

Also make sure to create the directory to which you will access the share from locally with:
mkdir /mnt/storage

This allows me to conveniently access ALL shares under TKLFS. Otherwise, you can mount only a specific share with /etc/fstab of:

Code:
//10.0.2.10/storage/music /mnt/music cifs credentials=/home/[user]/.credentials,noperm rw 0 0

On both Windows and Linux machines on my network, neither require a path that includes 'subvol-101-disk-0' to access the share via CIFS/Samba.

As an added note, my TKLFS CT does not have any PVE features turned on ( Datacenter>[node name]>[CT]>Options>Features. But, it IS a privileged CT.

Hope this helps!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!