Linux NFS 使用总结
1. 服务器nfs的配置
2. 客户端nfs的配置
3. 使用nfs
3.1 作为共享文件系统mount
3.2 作为根文件系统mount
4.备 注
nfs是Network File System,基于RPC(Remote Procedure Call Protocol远程过程调用协议)实现。
1.服务器nfs的配置
1.1 startàsystem settingànfs添加共享路径、允许访问的客户端IP以及访问方式
添加之后则存到/etc/exports文件中,如:/home/rrhudp0216 128.0.0.*(rw,sync):网络上共享/home/rrhudp0216,允许128.0.0.*网段的所有IP可以读写访问该文件夹。
1.2 services nfs restart重启nfs
1.3 services portmap restart 重启portmap
1.4 services iptables stop 关闭防火墙
1.5 services iptables status 防火墙状态查看(确认防火墙被关闭)
2.客户端nfs的配置
2.1 makemenuconfigàFile SystemsàNetwork File Systems中选上
2.2 Network Application中选择portmap项
3.使用nfs
3.1 作为共享文件系统mount
系统起来之后:
#mkdir /var/nfs
#chmod 777 nfs
#mount –t nfs –o tcp 128.0.0.7:/home/rrhudp0216 /var/nfs
# ls
Makefile fmod.c rrh_init.c~
Makefile_bk freqnum.h rrh_init.h
Makefile~ frequency.h rrh_init.o
…
3.2 作为根文件系统mount
在U-boot下设置U-boot环境变量:
U-boot->setenv bootargs ‘root=/dev/nfs rw nfsroot=128.0.0.7:/home/rrhudp0216,proto=tcp,nfsvers=3,nolock ip=128.0.0.28:128.0.0.7:128.0.0.1:255.255.0.0::eth0:off’
系统启动之后
NET: Registered protocol family 1
NET: Registered protocol family 17
IP-Config: Complete:
device=eth0, addr=128
相关文档:
你想成知道如何成为一个Linux内核开发者么?或者你的老板告诉你,“去为这个设备写一个Linux驱动。“这篇文档的目的,就是通过描述你需要经历的过程和提示你如何和社区一起工作,来教给你为达到这些目的所需要知道的所有知识。本文也尝试解释社区为什么这样工作的一些原因。
内核几乎全是用C写成的,有 ......
以前已经接触Windows下的Socket编程,最近也尝试着再linux下使用Socket编程,下面是在网上找的例子(已经测试过)
tcp_server.c:
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdlib.h>
# ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
A:link { so-language: zxx }
-->
一个
Linux
发行版,体积很小,用处反而很大。此话当真?
一般而言,老式计算机内存都不大, ......
1 进程管理相关代码
1.1 thread_info结构,在文件<asm/thread_info.h>中定义
struct thread_info {
struct task_struct *task;
struct exec ......