路虽弥,不行不至;事虽少,不做不成。
分类: LINUX
2006-12-21 15:38:00
NFS &autofs
# sample /etc/exports file (setup-
/ master(rw) trusty(rw,no_root_squash)
/projects proj*.local.domain(rw)
/usr *.local.domain(ro) @trusted(rw)
/home/joe pc001(rw,all_squash,anonuid=150,anongid=100)
/pub (ro,insecure,all_squash)
The first line exports the entire filesystem to machines master and trusty.In addition to write access, all uid squashing is turned off for host trusty. The second and third entry show examples for wildcard hostnames and netgroups (this is the entry trusted). The fourth line shows the entry for the PC/NFS client discussed above. Line 5 exports the public FTP directory to every host in the world, executing all requests under the nobody account. The insecure option in this entry also allows clients with NFS implementations that do use a reserved port for NFS.
1 NFS SERVER (/etc/exports) <----exportfs -a (全部导出)
|
|
|
2 nfs client(三种挂载方法)
服务器端
1.1修改/etc/exports
/tmp 192.168.1.0/24(rw,sync,all_squash,anonuid=500,anongid=501)
1.2 启动服务service nfs start
1.3 导出文件系统 exportfs -a
客户端(service nfs start)
2.1. 启动挂载/etc/fstab
192.168.1.117:/home /misc nfs defaults 0 0
2.2.手工挂载
# mount -t nfs 192.168.1.117:/home /misc
2.3.自动挂载
加一行
/misc /etc/auto.misc
abcd 192.168.1.117:/home
注:abcd这个名称在本机是没有的,是自动生成的