cancel
Showing results for 
Search instead for 
Did you mean: 

Guide on how to Setup NFS client on STM32MP2X

niuwenxu
ST Employee

 

This guide uses ubuntu22.04 x86 pc(Probably the same on any other Linux system) as host, and mp2 as device.

Its quite a common practice to use NFS as a medium to transfer cross compiled binary to dev board, since using sftp or scp to transfer the file every time you cross compile is tedious and time consuming.

 

  • Install NFS server and prepare the export directory on host : 

         sudo apt update && sudo apt install nfs-kernel-server 

         sudo mkdir -p /host_export_srv_dir 

         sudo chown -R nobody:nogroup /host_export_srv_dir

         sudo chmod 777 /home/srv 

 

  • Edit export file on host: 

         sudo vim /etc/exports 

             /home/srv  *(rw,sync,no_subtree_check) 

 

  • Export the directory

           sudo exportfs -a 

           sudo systemctl restart nfs-kernel-server 

 

  • Disable the firewall on host

            sudo ufw allow from MP2IPAddr to any port nfs 

             sudo ufw enable 

             sudo ufw status 

 

  • Install the nfs client on device: 

              Please run as su

              apt update && apt install  nfs-utils 

 

  • Mount the NFS directory on device

             mount -v -t nfs  138.198.198.58:/home/srv /srv 

 

  • To Mount NFS on boot, Edit /etc/fstab  file on device to : 

            Warning: it may make boot time longer 

             138.198.198.58:/home/srv     /srv         nfs        defaults              0  0 

 

 

 

 

  • Extra note:

           Please use df command to check mount successfully or not.

 

        Picture1.png

 

         To un-mount volume on device: 

          umount /srv 

 

 

 

 

0 REPLIES 0