1、要实现文件系统挂载的前提,服务端和客户端必须在同一个网段,测试可以ping下,退出ping是CTRL+C快捷键
2、vmvare设置为桥接,bridged to PC机网卡芯片
3、mini2440和PC机的网线可以交叉线连,或者通过路由器,反正保证统一局域网就行
mini2440通过secureCRT的串口打印如下
[root@FriendlyARM nfs]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:90:90:90:90:90
inet addr:192.168.10.230 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1243 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:86535 (84.5 KiB) TX bytes:1824 (1.7 KiB)
Interrupt:51 Base address:0x4300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
UBUNTU10.4终端打印如下
[root@localhost mnt]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:02:AE:2F
inet addr:192.168.10.18 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:ae2f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7196 errors:0 dropped:0 overruns:0 frame:0
TX packets:302 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:484599 (473.2 KiB) TX bytes:33482 (32.6 KiB)
Interrupt:67 Base address:0x2024
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3361 errors:0 dropped:0 overruns:0 frame:0
TX packets:3361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5914480 (5.6 MiB) TX bytes:5914480 (5.6 MiB)
若ubuntu10.4的网段不在192.168.10段则需要配置在10网段,配置方法如下:
root@xjyou:/home/xjyou# vim /etc/network/interfaces
打开后加入红色字体部分
1 auto lo
2 iface lo inet loopback
3 auto eth0
4 iface eth0 inet static
5 address 192.168.10.18
6 gateway 192.168.10.1
7 netmask 255.255.255.0
8 network 192.168.10.0
9 broadcast 192.168.10.255
7 netmask 255.255.255.0
8 network 192.168.10.0
9 broadcast 192.168.10.255
root@xjyou:/home/xjyou# vim /etc/resolv.conf
改nameserver为10网段任意值
1 # Generated by NetworkManager
2 domain localdomain
3 search localdomain
4 nameserver 192.168.10.1
root@xjyou:/home/xjyou# /etc/init.d/networking restart
执行restart完成配置
root@xjyou:/home/mini2440# vim /etc/exports
加入下面,表示允许192.168.10网段的所有客户端来挂载/home/mini2440/nfs目录到客户端的各自目录
/home/mini2440/nfs 192.168.10.*(rw,sync,no_root_squash,no_subtree_check)
root@xjyou:/home/mini2440# /etc/init.d/nfs-kernel-server restart
重启nfs服务
最终在mini2440上输入:
[root@FriendlyARM /mnt]# mount -t nfs -o nolock 192.168.10.18:/home/mini2440/nfs /mnt/nfs
挂载成功