Psilospiral's picture

Greetings forum:

I have installed Turnkey fileserver onto Proxmox (PVE) via a container template (CT) in an attempt to share a ZFS pool created via PVE CLI.  (I'm trying my best to stay away from FreeNAS, UNraid, and the rest...)

After the installation, I added a mountpoint to the fileserver CT via PVE WebUI.

When I go to the shell in fileserver CT and navigate to /srv/storage , I see the default README.txt file from Turnkey Linux, which is situated on the root Turnkey fileserver filesystem.

When I go to the shell in fileserver CT and navigate to /mnt/storage, I see the contents of my mounted ZFS pool that was created via PVE CLI (and do not see the README.txt file).

I now want to change the default storage path in Turnkey fileserver from /srv/storage to /mnt/storage so that I am using the storage configured under the PVE machine, not the root disk of the CT (which is much, much smaller)...

How do I do this?  Thanks in advance!

 

Forum: 
Jeremy Davis's picture

As with most things in Linux, there are a variety of ways to achieve your ends. IIRC via the commandline, you could change/set the PVE mount location within your server to explicitly be /srv/storage.

Although if you'd rather not do that, then another option would be to use a bind mount within the fileserver. Bind mounts allow you to mount one area of the filesystem over the top of another (regardless of whether they are the same filesystem or not). So to mount /mnt/storage over the top of /srv/storage (which will explicitly give you what you are after) try this:

mount --bind /mnt/storage /srv/storage

If you now look in /srv/storage, you should now no longer see the default README.

Please note though, that this will not survive a reboot. Once you have it set as desired and working as you want, to ensure that it's reapplied on reboot, you'll need to add it to your fstab (/etc/fstab). The line that you'll want will be something like this:

/mnt/storage /srv/storage none defaults,bind 0 0

To double check your fstab entry, manually remove the bind mount:

umount /srv/storage

Then run:

mount -a

If there are issues with your fstab, you'll get an error message. Otherwise, you should see the mount in place (as per when you did it manually above).

It's worth noting that permission adjustments may be required on the new /srv/storage location.

I hope that helps.

Psilospiral's picture

Thank you for your help, Jeremy!  I tried your suggestion:

mount --bind /mnt/storage /srv/storage

When I went to WebDAV on a host on the LAN and refreshed the page, I immediately noticed the README.txt file missing and a much larger available volume, which was obviously my host ZFS pool instead of the root file system of Turnkey File Server.  Problem sovled!

However, I wanted to go a little further and attempt to achieve the same results from within PVE.  After reinstalling Turnkey File Server (a few times) and researching more within forums, I discovered how.

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

And that's it!  By adding a mount point to the CT from within PVE WebUI that matches Turnkey File Server's default storage mount point of /srv/storage , Turnkey File Server then utilizes the local ZFS storage pool on the PVE host.  There is no PVE CLI or modifications to the /etc/pve/qemu-server/<VMID>.conf necessary!

I will now head back over to PVE forums and try to understand any pros or cons of both methods.

Thank you again for all of your help!

 

Jeremy Davis's picture

I'm glad that my suggestion worked.

I'm also glad to hear that Proxmox have added that functionality to their GUI. I'm not sure when they added that, but I recall doing that some time ago and at that point it was not yet possible via the UI (I've been using Proxmox since v1.8, so no idea when they added that).

As far as pros and cons of each method, TBH, I think that mounting the filesystem exactly where you want it, direct from Proxmox is probably preferable. Mostly because it's then a single operation (you're mounting the filesystem within the container anyway, why not mount it directly where you want it?!). Although I can't think why mount binding it within the container would be an issue. So it probably comes down to personal preference. Having said that, if anyone over on the PVE forums mentions any good points, please feel free to post back! :)

Psilospiral's picture

I do like the idea of utilizing the PVE WebUI to add the /srv/storage mount point to the Turnkey File Server CT - and - this being the only requirement for Turnkey File Server to utilize the local ZFS storage on my PVE server.  Of course, bind mounting it in /etc/fstab is not difficult after one knows what to do!  It's great to have both options.

Thank you again for your help.  I'm new to Turnkey and so far the experience has been great!  I will be working with File Server for a while before moving on to configuring Turnkey Syncthing...

 

Jeremy Davis's picture

You are most welcome on the assistance.

If you have any further questions please feel free to ask. Also if you discover anything that you think might be worth sharing, that's always good too! Even just sharing your experience is often useful to others. :)

Good luck with it all and hopefully chat further another day.

Add new comment