ubuntu 16.04搭建NFS服务器方法

1、ubuntu 16.04 软件下载安装
apt-get install nfs-kernel-server nfs-common portmap

2、创建NFS目录并解压文件系统
cd /home/imhqq/share/huqiqiao/
mkdir nfs
cd nfs
拷贝rootfs.tar.bz2到nfs目录
tar -zxvf rootfs.tar.bz2

3、修改配置文件
vim /etc/exports
在配置文件中添加以下配置:
/home/imhqq/share/huqiqiao/nfs *(rw,sync,no_root_squash)

4、重启配置文件和服务
exportfs -rv
/etc/init.d/rpcbind restart
/etc/init.d/nfs-kernel-server restart

1,2,3,4在NFS服务器执行(版本编译机),5在开发板上实现。

5、验证nfs服务器,执行完成以下命令查看/mnt目录,会看到刚才解压的文件系统。
(1)下面两行可以在开发板的命令行中执行:
mount -t nfs -o nolock,nfsvers=3,vers=3 192.168.9.58:/home/imhqq/share/huqiqiao/nfs /mnt
chroot /mnt

(2)也可以通过修改开发板的/etc/matchbox/session文件,增加上面两行代码实现。具体如下:

飞凌开发板配置NFS步骤:

1、首先手动配置IP,然后ssh方式连接到单板。
ifconfig eth0 192.168.9.56 netmask 255.255.255.0 broadcast 192.168.9.255 up

2、再固定飞凌板子的IP:
修改:/etc/matchbox/session

root@imx6qsabresd:~# vi /etc/matchbox/session

!/bin/sh

. /etc/formfactor/config

if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
SHOWCURSOR="no"
else
SHOWCURSOR="yes"
fi

if [ "$HAVE_KEYBOARD" = "1" ]; then
KEYBOARD_APPLET=""
else
KEYBOARD_APPLET="keyboard"
fi

Tell GTK+3 we really want server side decorations, even with

GtkHeaderBar using applications: Without that mb-panel will render

on top of the client side decorations.

export GTK_CSD=0

matchbox-desktop &

ifconfig eth0 192.168.9.56 netmask 255.255.255.0 broadcast 192.168.9.255 up

Lines containing feature-[foo] are removed at build time if the machine

doesn't have the feature "foo".

START_APPLETS=showdesktop,windowselector
END_APPLETS=clock,battery,$KEYBOARD_APPLET,systray,startup-notify,notify

matchbox-panel --titlebar --start-applets END_APPLETS &
touch -P /mnt
mount -t nfs -o nolock,nfsvers=3,vers=3 192.168.9.58:/home/imhqq/share/huqiqiao/nfs /mnt
exec matchbox-window-manager -theme Sato -use_desktop_mode decorated -use_cursor @
export DISPLAY=:0.0
chroot /mnt

3、执行复位单板,uboot阶段输入r。再输入1,选择4,再输入0,接着输入0,进入uboot,输入uboot命令reset,复位单板。

4、上面2中已经配置了nfs方式。

你可能感兴趣的:(ubuntu 16.04搭建NFS服务器方法)