Ubuntu20下安装NFS,用于嵌入式开发

Ubuntu20下安装NFS,用于嵌入式开发,第1张

Ubuntu20下安装NFS,用于嵌入式开发

上次安装好了Ubuntu20,开启了SSH,FTP服务,但要做嵌入式开发,还必须要做的一件事,就是给Ubuntu开启NFS服务,

1、install…

sudo apt-get install nfs-kernel-server

2、想好自己要把哪个目录作为NFS共享目录,创建目录

mkdir /home/hudahua/share

3、配置脚本 /etc/exports 添加我们自己想要共享的目录

sudo vi /etc/exports

/home/hudahua/share *(rw,sync,insecure,no_subtree_check,no_root_squash)

4、重启Ubuntu NFS服务

sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart

5、测试Ubuntu NFS
测试方法一:
通过命令:

showmount -e

查看
测试方法二:
上次有看到,我的电脑的有不止安装有一个Ubuntu系统
系统,下面就开启另外一个Ubuntu9系统来测试
1、打开Ubuntu9(192.168.0.19)
先确定网络互通
book@book-desktop:~$ ping 192.168.0.178
PING 192.168.0.178 (192.168.0.178) 56(84) bytes of data.
64 bytes from 192.168.0.178: icmp_seq=1 ttl=64 time=1.66 ms
64 bytes from 192.168.0.178: icmp_seq=2 ttl=64 time=0.608 ms
64 bytes from 192.168.0.178: icmp_seq=3 ttl=64 time=0.285 ms

Ubuntu20拼Ubuntu9
hudahua@hudahua-virtual-machine:~$
hudahua@hudahua-virtual-machine:~$ ping 192.168.0.19
PING 192.168.0.19 (192.168.0.19) 56(84) bytes of data.
64 bytes from 192.168.0.19: icmp_seq=1 ttl=64 time=0.517 ms
64 bytes from 192.168.0.19: icmp_seq=2 ttl=64 time=0.410 ms
2、然后在Ubuntu9上挂载Ubuntu20的NFS目录

 sudo mount -t nfs -o nolock 192.168.0.178:/home/hudahua/share /mnt


挂载完成,查看 mnt目录下的文件即可

ls /mnt

3、NFS卸载命令

sudo umount /mnt

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5693904.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存