Ubuntu-12.04LTS配置NFS和TFTP服务

2680阅读 0评论2013-11-27 wangtisheng
分类:嵌入式

                Ubuntu-12.04LTS配置NFS和TFTP服务

一、安装、配置NFS服务
    
1.1    安装NFS
            $ sudo apt-get install nfs-kernel-server portmap
    1.2    编辑/etc/exports,添加需要挂接NFS的主机(ubuntu)目录
            /home/wangtisheng/work/nfs      *(rw,sync,no_root_squash)
    1.3    重启ubuntu系统的nfs服务
            sudo /etc/init.d/nfs-kernel-server restart
    1.4    启动端口映射
            $ sudo /etc/init.d/portmap start
    1.5    输入exprotfs -rv命令重新导出NFS共享目录,查看是否包含/work/nfs目录
            $ sudo /usr/sbin/exportfs -rv
    1.6    测试NFS服务
            $ sudo mount -t nfs 192.168.1.102:/home/wangtisheng/work/nfs  /mnt
                mount.nfs: /mnt is busy or already mounted  
                =》(如果出现这种情况,可以先用umount命令卸载一下,如果多次mount可能会导致目录不可用)
            sudo umount /mnt 
            一般为了保险期间,可以在挂载之前先用一下umount。之后再挂载,这次就可以了。
            $ sudo mount -t nfs 192.168.1.102:/home/wangtisheng/work/nfs  /mnt
            查看一下,进入/mnt目录下,就可以看到/work/nfs中的内容说明挂载成功。

二、安装、配置tftp服务
    
2.1    安装程序
                $ sudo apt-get install openbsd-inetd tftpd tftp
    2.2    在/home/wangtisheng/work目录下的tftp目录属性改成777
                $ cd ~/work
                $ chmod 777 tftp
    2.3    修改存放目录
                $ sudo vim /etc/inetd.conf
                    ++tftp dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.tftpd /home/wangtisheng/work/tftp     
    
2.4    重新启动服务
                $ sudo /etc/init.d/openbsd-inetd restart
                $ sudo in.tftpd -l  /home/wangtisheng/work/tftp
    2.5    测试一下,在/work/mini2440/nfs_tftp文件夹下新建立一个文件
                $ cd /home/wangtisheng/work/tftp
                $ touch test
            进入另外一个文件夹
                $ tftp 192.168.1.102
                $ tftp> get test
上一篇:mini2440之bootcmd和bootargs设置
下一篇:让Source Insight完美支持中文注释