petalinux 连接ubuntu NFS服务器

ubuntu开启nfs服务器

1、安装nfs服务器

sudo apt-get install nfs-kernel-server

2、新建一个目录作为共享目录
3、编辑/etc/exports 文件,配置 NFS 服务路径

sudo gedit /etc/exports

在diamagnetic最下方添加 /home/alinx/work *(rw,sync,no_root_squash,no_subtree_check) /home/alinx/work 目录为 NFS 的一个工作目录。

4、执行下面命令重启 rpcbind 服务。nfs 是一个 RPC 程序,使用它前,需要映射好端口,通过rpcbind 设定

sudo /etc/init.d/rpcbind restart

5、执行下面命令重启 nfs 服务

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

petalinux连接nfs服务器

1、通过下面命令挂载 NFS,在本机将 NFS 工作路径挂载在/mnt 目录,127.0.0.1 就是本机 IP

mount -t nfs 127.0.0.1:/home/alinx2020/work/ /mnt

或者

mount -t nfs -o nolock 192.168.2.17:/home/laohu/work /mnt

注意:若报错

root@petalinux:~# mount -t nfs 192.168.2.17:/home/laohu/work/ /mnt
mount: /mnt: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.

则先运行

ln -s -f /bin/busybox /bin/mount

linux 使用命令kill关闭应用

1、找到需要关闭程序的应用名称

2、通过ps aux | grep alinx_ui1 查看该应用程序的 PID

3、kill PID 杀死对应的应用

petalinux 默认启动的 alinx_ui1 的 PID为 726