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
客户端需要能 ping 通服务器
使用 U-Boot 下载文件,版本问题,会出错:
原因:
uboot中使用得NFS版本为V2版本,而ubuntu中的NFS版本为V3,V4及以上版本,从而导致uboot不能再NFS服务器中找到文件。
解决:
修改配置文件:sudo vim /etc/default/nfs-kernel-server
然后重启服务:sudo service nfs-kernel-server restart