LiquidFiles Documentation
LiquidFiles Documentation
Updated v4.0

Using an external NFS server

The LiquidFiles data storage is not accessible by humans (or other systems)

Some times we get questions if by using NFS as a data storage it would be possible to directly interact with the LiquidFiles data storage — i.e. if users could retrieve or place files directly into the data storage. They can not! Regardless if you're using on-system storage or NFS storage, the LiquidFiles data storage needs to be treated as an opaque blob of data. Files are stored in randomized directories and filenames are sanitized for storage (real filenames are preserved in the database). If you add any files to the LiquidFiles data storage they will be automatically deleted by the LiquidFiles maintenance. And if you delete files directly from the data storage it will lead to inconsistencies where LiquidFiles will think files are available but they aren't, so they will be presented to any user as available and the user will get an error when trying to download.

NFS is only really a good option if you have large amounts of variable data you're planning to use with LiquidFiles and you don't want to pre-allocate data to the LiquidFiles virtual disk. You will almost certainly see a performance degredation with NFS so you're basically trading storage efficiency for performance.

There is zero functional difference between using NFS and a local disk for data storage. Neither humans nor other systems can be given access the LiquidFiles data storage, NFS or local disk.

To use an external NFS server with LiquidFiles, please follow the following steps.

First, to enable running NFS, please run the following command:

ft nfs_enable

All LiquidFiles file data is stored in /data. You need to move this data to the NFS server. Please stop the LiquidFiles appliance web application and web server:

ft stop

Continue to move the existing data and create a new NFS mount point and mount the NFS server:

mv /data /data.old
mkdir /data
chown _sfta:_sfta /data
mount server:/mount/point /data

(Replacing server:/mount/point with your NFS server details)

All files in the /data folder needs to be owned by the _sfta user which has the user id (uid) and group id (gid) of 900. If you configure any form of user or group restrictions on the NFS server, make sure that they match these requirements (when you're done, please run `ls -l /data` and everything should show up as _sfta owner and _sfta group or the application won't run properly).

You are now ready to copy all the data across to the NFS server:

cp -rp /data.old/* /data
chown -R _sfta:_sfta /data

This is likely going to take a while, depending on how much data you have stored.

When this has completed, you can start the server again with:

ft start

If everything is working as expected, make sure that the NFS server gets mounted on each reboot by running the command:

echo "server:/mount/point /data nfs rw,nodev,nosuid 0 0" >> /etc/fstab

(Replacing server:/mount/point with your NFS server details)

That completes the setup of the NFS storage for the LiquidFiles appliance. When you're comfortable that everything is working, including after a reboot, you can delete the previous data folder with `rm -r /data.old`.