.. _nfs-setup-guide: Setup NFS ========= When working with large datasets or model files, fast and efficient file access is essential for a smooth demo and development experience. Using NFS (Network File System) enables seamless file sharing between an Ubuntu machine (server) and the Modalix DevKit (client), providing direct access to large storage without requiring local copies. .. note:: NFS is particularly useful when the DevKit lacks high-speed, large-capacity storage such as NVMe. This applies to platforms like the MLSoC and the Modalix Early Access Kit (EA), where relying solely on SD cards can lead to slower load times. NFS can be especially helpful when: - Large models or datasets need to be shared across multiple devices. - Local storage on the client is limited or unavailable. - Centralized storage management is preferred for simplified updates. .. dropdown:: Step 1. Setting Up the NFS Server :animate: fade-in :color: secondary :open: 1. **Install the NFS Kernel Server**: .. code-block:: bash sima-user@sima-user-machine:~$ sudo apt update sima-user@sima-user-machine:~$ sudo apt install -y nfs-kernel-server 2. **Create a Shared Directory**: Choose a directory to share with the Modalix DevKit: .. code-block:: bash sima-user@sima-user-machine:~$ sudo mkdir -p /mnt/nfs_share sima-user@sima-user-machine:~$ sudo chmod 777 /mnt/nfs_share 3. **Edit the NFS Exports File**: Open the exports file: .. code-block:: bash sima-user@sima-user-machine:~$ sudo nano /etc/exports Add the following line at the end, replacing `` with the Modalix DevKit's IP address: .. code-block:: none /mnt/nfs_share (rw,sync,no_subtree_check) If you want to allow access from any IP in your network (for testing), use: .. code-block:: none /mnt/nfs_share *(rw,sync,no_subtree_check) 4. **Apply the Changes and Restart NFS Service**: .. code-block:: bash sima-user@sima-user-machine:~$ sudo exportfs -a sima-user@sima-user-machine:~$ sudo systemctl restart nfs-kernel-server .. dropdown:: Step 2. Setting Up the NFS Client :animate: fade-in :color: secondary :open: 1. **Create a Mount Point**: .. code-block:: bash modalix:~$ sudo mkdir -p /mnt/ 2. **Mount the NFS Share**: Replace `` with the Ubuntu machine's IP address: .. code-block:: bash modalix:~$ sudo mount :/mnt/nfs_share /mnt/ 3. **Verify the Mount**: Check if the NFS share is mounted correctly: .. code-block:: bash modalix:~$ df -h | grep mnt .. dropdown:: Step 3. Making the Mount Persistent :animate: fade-in :color: secondary :open: To automatically mount the NFS share at boot, perform the following steps on Modalix: 1. **Create the ``mnt.mount`` file**: .. code-block:: bash modalix:~$ sudo vi /etc/systemd/system/mnt.mount 2. **Add this content to the file, be sure to replace the server_IP to the Ubuntu machine:** .. code-block:: none [Unit] Description=NFS Mount After=network-online.target Requires=network-online.target [Mount] What=:/mnt/nfs_share Where=/mnt/ Type=nfs Options=defaults,_netdev [Install] WantedBy=multi-user.target 3. **Save and exit. Then, test the configuration:** .. code-block:: bash modalix:~$ sudo systemctl daemon-reload modalix:~$ sudo systemctl enable mnt.mount modalix:~$ sudo systemctl start mnt.mount