Ubuntu20 安装 NFS
NFS 用于 Linux 直接共享文件。
NFS 服务器端
-
安装
sudo apt-get install nfs-kernel-server
-
修改配置文件:
sudo vim /etc/exports
添加:
/home/luo/nfs ( 共享文件目录 ) *(rw,sync,no_root_squash)
修改文件权限:
chmod -R 777 /home/luo/nfs
修改用户组:
chown -R luo:luo /home/luo/nfs
-
重启服务
sudo /etc/init.d/nfs-kernel-server restart
NFS 客户端
-
安装
sudo apt-get install nfs-common
-
挂载共享文件:
sudo mount -t nfs 192.168.1.15( 服务器地址):/home/luo/nfs /mnt -o nolock
-
设置开机自动挂载
在
/etc/fstab
中添加192.168.1.15( 服务器地址):/home/luo/nfs /mnt nfs rw 0 0
U-Boot nfs 出错
问题描述:
版子能 ping 通主机,使用 nfs 时提示
原因:
uboot中使用得NFS版本为V2版本,而ubuntu中的NFS版本为V3,V4及以上版本,从而导致uboot不能再NFS服务器中找到文件。
解决:
修改配置文件:sudo vim /etc/default/nfs-kernel-server
然后重启服务:sudo service nfs-kernel-server restart