In the previous article, we delved into the step-by-step process of converting an Unprivileged LXC into a Privileged LXC in our Home Lab.
In this article, we will be looking at the steps to mount an NFS share from our TrueNAS instance in our Proxmox LXC.
Network File System (NFS) provides a powerful and flexible solution for sharing files between different systems on a network. It is a distributed file system protocol that allows a user on a client computer to access files over a network as if they were on local storage. NFS transforms the conventional paradigm of file sharing, enabling devices to collaborate and share resources seamlessly. It provides a standardized method for accessing files across different systems.
Key Characteristics of NFS include:
- Centralized Storage
- Cross-Platform Compatibility
- Efficient Data Transfer
- Security Measures
Why NFS in Proxmox LXC:
Mounting an NFS share in a Proxmox LXC opens up new possibilities for storage management within our Home Lab. NFS facilitates seamless file sharing across devices, and Proxmox LXC allows us to containerize applications efficiently. Also in the further articles, we will be installing various services which will use this NFS share to store the files.
Steps to Mount the NFS Share:
- First, we need to enable the NFS share from our TrueNAS instance. For that, we first need to log in to our TrueNAS instance.
- Now we can click on the Shares option to enable our NFS share.
- We can now click on the Add button near the NFS shares option to add an NFS share.
- Now we can select the path to store our data and then click on the save button to enable the NFS share.
- We now need to enable the NFS option in our Proxmox LXC to mount this NFS share. For that, we can log in to our Proxmox instance and head over to the LXC.
- Here we can click on the Options tab.
- We now can click on the Features option to enable the NFS functionality.
- We can check the box next to NFS and save the changes. We now can start the LXC to mount the NFS share.
- After the LXC is started, we can log in to our LXC using SSH or via Proxmox Console.
- To mount an NFS share on a LXC first we need to install the NFS client packages. We can type in the below command to install the same.
sudo apt install nfs-common
- Generally, we will want to mount the NFS share automatically when the system boots. The "/etc/fstab" file contains the list of entries that define what will be mounted when the system gets booted.
- To mount the NFS share automatically during boot, we will be adding an entry in this file.
- First, we need to create a directory. The NFS share will be mounted to this directory. We can use the below command to create the same.
sudo mkdir NFS
- Now we need to open the "/etc/fstab" file. We can type in the below command to open the same.
sudo nano /etc/fstab
- Now we can add the following line to the file to automatically mount the NFS share along with the directory where we will be mounting the same.
- I have used the location of the NFS folder which we created just now in the below line.
- We can now restart the LXC to automatically mount the NFS share. We can also type in the below command to mount immediately without any restarts.
sudo mount NFS
- We can see that our NFS share has been successfully mounted in our Proxmox LXC.
- To unmount the NFS file system, we can remove the line that we added in the '/etc/fstab' file or we can type in the below command to unmount.
sudo umount NFS
We have now successfully looked into the step-by-step process of mounting an NFS share in our Proxmox LXC. We also looked into the command to unmount the same. The above steps also work for mounting the NFS share on any Linux-based operating system.
We now will be able to store all our files remotely in our TrueNAS instance from our LXC using this NFS share. We will be using this functionality frequently in further articles.
In this article, we have explored the process of mounting and unmounting an NFS share in our Proxmox LXC for our Home Lab!
In the next article, we will be looking into another service that we will be deploying in our Home Lab. Stay tuned for more detailed instructions on expanding our Home Labbing capabilities.