Forum archive
fileserver - How to change default storage path?
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!
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:
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:
To double check your fstab entry, manually remove the bind mount:
Then run:
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.