Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4138137
  • 博文数量: 241
  • 博客积分: 15936
  • 博客等级: 上将
  • 技术积分: 25293
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-27 11:22
个人简介

Fedora-ARM

文章分类
文章存档

2016年(3)

2014年(1)

2013年(3)

2012年(50)

2011年(61)

2010年(26)

2009年(27)

2008年(21)

2007年(49)

分类: LINUX

2010-04-11 18:04:39

Ubuntu下安装配置NFS网络服务手记
 在Linux做嵌入式开发一定会用到NFS网络服务,下面以Ubuntu下使用apt-get安装为例,简单记录一下安装配置过程,大致步骤如下:

(1)安装NFS内核服务;
(2)重新配置portmap服务,修改/etc/hosts.deny和/etc/hosts.allow配置文件,重启portmap服务;
(3)修改NFS服务的配置文件/etc/exports,添加服务目录和配置,重新导入配置;
(4)重启NFS服务,并检查可挂载的目录;
(5)在本地挂载测试。


我为了记录写了一个很简单的安装和配置脚本,是一些主要步骤:

#!/bin/sh
    echo install tftp server ...
        sudo apt-get install nfs-kernel-server
        if [ "$?" = "0" ]
        then
            echo "install nfs-kernel-server OK!!"
        else
            echo "install nfs-kernel-server error !!!"
#            exit 1    
        fi

    sudo dpkg-reconfigure portmap
    #对Should portmap be bound to the loopback address? 选N.

    sudo vi /etc/hosts.deny
#portmap:ALL
#lockd:ALL
#mountd:ALL
#rquotad:ALL
#statd:ALL

    sudo vi /etc/hosts.allow
#portmap: 192.168.1.
#lockd: 192.168.1.
#rquotad: 192.168.1.
#mountd: 192.168.1.
#statd: 192.168.1.

    sudo service portmap restart

    sudo vi /etc/exports
    #/home/tekkaman/development/share 192.168.1.0/24(rw,nohide,insecure,no_wdelay,no_root_squash,no_subtree_check,sync)
    #特别要注意上面的IP的形式,以前是形如192.168.1.*,现在是IP/掩码为数的形式。用旧的格式可能会出问题
    #具体的说明,建议看man手册 : man exports
    sudo exportfs -r

    sudo /etc/init.d/nfs-kernel-server restart
    showmount -e 127.0.0.1

 
 
阅读(6065) | 评论(1) | 转发(7) |
给主人留下些什么吧!~~

chinaunix网友2010-05-18 22:09:53

呃,那个IP形式:192.168.1.0/24叫CIDR