歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

Gentoo Linux下配置NFS(網絡文件系統)

主機:Gentoo Linux 11.2

內核:Linux 3.0.6

1、內核編譯配置

編譯內核配置如下,選中NFS服務器支持



2、用於空間軟件准備

命令安裝nfs-utils

[java]
  1. emerge -av nfs-utils  
3、配置NFS用戶目錄及其權限在/etc/exports下

按自己的要求改寫

/home/user/shared 192.168.0.3(async,rw,no_subtree_check)
/home/user/shared2 192.168.0.0/255.255.0.0(async,rw,no_subtree_check)
/mnt/portage 192.168.0.0/16(async,no_subtree_check,rw,no_root_squash)

而括號中的參數含義如下:

  • rw - Allow read and write access
  • ro - Allow read only access - no write access
  • async - Reply to requests before data has been committed to the file system. This improves performance, but increases the risk of data loss in the event of a server crash.
  • no_subtree_check - Disable subtree checking. The technical details are in the man page, but essentially it's recommended for read/write filesystems where files change frequently, such as /home. If you disable subtree checking and export something that's not the root of a filesystem, it's possible a client could access a file outside the exported directory, however.
  • root_squash - Prevent the client creating files owned by root - instead they will be owned by the anonymous uid/gid (user id / group id, see man page for details).
  • no_root_squash - Turn off root squashing. Mostly used on diskless clients.
  • all_squash - Map all uids/gids to the anonymous user. This means that all files written to this filesystem will be owned by the same user.
3、啟動NFS服務

[cpp]
  1. /etc/init.d/nfs start  
在開發板上掛載主機目錄成功。

Copyright © Linux教程網 All Rights Reserved