热门关键字:  ubuntu  分区  函数  Fedora  linux系统进程

E680应用(2)—— E680上通过nfs共享PC机文件

来源: 作者: 时间:2008-07-11 Tag: 点击:

By zieckey ( http://blog.chinaunix.net/u/16292/index.html )
All Rights Reserved

前面一文中http://blog.chinaunix.net/u/16292/showart_1076447.html已经实现了在Linux系统的PC机上telnet到E680手机的Linux系统。

为了后续开发的方便,我们急迫的需要方便的文件传输方式,这里我选择nfs。

[root@localhost helloworld]# cat /etc/exports
/mnt/nfs *(rw,no_root_squash)

首先在PC机上开启NFS服务。从上面可以看到我的共享目录是 /mnt/nfs

然后telnet连接到手机:

iptables -A INPUT -i usb0 -j ACCEPT
iptables -A OUTPUT -o usb0 -j ACCEPT
ifconfig usb0 192.168.1.6
telnet 192.168.1.2
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'.

MontaVista Linux Consumer Electronics Edition 3.0
Linux/armv5tel 2.4.20_mvlcee30-mainstone


(none) login: root
Linux 192.168.1.11 2.4.20_mvlcee30-mainstone #7 Fri Feb 13 15:39:51 CST 2004 armv5tel unknown

MontaVista Linux Consumer Electronics Edition 3.0

No directory /root!
Logging in with home = "/".
# ls
bin diska etc home mmc ram sbin usr
dev diskb ezxlocal lib proc root tmp var

好了。现在已经telnet到手机了,然后在手机上输入mount命令挂载nfs:

# mount -t nfs -o nolock 192.168.1.6:/mnt/nfs /diska/mnt
# ls /diska/mnt
welcome

这里注意下mount的命令参数:-t nfs -o nolock 不能少

现在手机里的/diska/mnt目录就是挂在的PC 机 linux系统上的/mnt/nfs,并且具有可读写权限。

下面的开发就方便多了。


最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册