栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

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

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/693438.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号