Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1459552
  • 博文数量: 181
  • 博客积分: 3308
  • 博客等级: 中校
  • 技术积分: 2227
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-03 12:03
个人简介

我是zoro

文章分类

全部博文(181)

文章存档

2015年(1)

2013年(35)

2012年(39)

2011年(50)

2010年(56)

分类: LINUX

2010-12-23 21:56:54

1.安装nfs服务器端与客户端
    $sudo apt-get install nfs-kernel-server nfs-common portmap
    安装客户端的作用是可以在本机进行nfs测试
2.配置portmap
    方法1:通过编辑/etc/default/portmap
    
    $sudo vi /etc/default/portmap
    1 # Portmap configuration file
    2 #
    3 # Note: if you manually edit this configuration file,
    4 # portmap configuration scripts will avoid modifying it
    5 # (for example, by running 'dpkg-reconfigure portmap').
    6
    7 # If you want portmap to listen only to the loopback
    8 # interface, uncomment the following line (it will be
    9 # uncommented automatically if you configure this
    10 # through debconf).
    11 #OPTIONS=""

    注释掉最后一行OPTIONS.

    方法2:
    $sudo dpkg-reconfigure portmap
    运行后选择.
    另外,要用sysv-rc-conf(不是chkconfig)工具查看一下当前nfs和portmap的     状态,若是off,则用sudo sysv-rc-conf portmap on 或 sudo sysv-rc-confnfs-    kernel-server on 打开。

3.配置挂载目录
    $sudo vi /etc/exports

    1 # /etc/exports: the access control list for filesystems which may be exporte    d
    2 #               to NFS clients.  See exports(5).
    3 #
    4 # Example for NFSv2 and NFSv3:
    5 # /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_    subtree_check)
    6 #
    7 # Example for NFSv4:
    8 # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
    9 # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
    10 #
    11 /home/nfs/qemu-target-armv5l 192.168.200.*(rw,no_root_squash,subtree_check,async)
    做后一行是所需配置

4.创建共享文件夹
    sudo mkdir /home/nfs/qemu-target-armv5l

5.更新exports文件
    更改了/etc/exports之后,通过下面命令更新生效
    $sudo exportfs -r

6.重启nfs服务
    $sudo /etc/init.d/nfs-kernel-server restart

7.挂载
    $sudo mount -t nfs localhost:/home/nfs/qemu-target-armv5l /mnt

8.查看
    $showmount -e localhost

卸载NFS服务
    $sudo umount /mnt
阅读(1693) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-12-26 17:22:17

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com