Gentoo Linuxの下でNFS(ネットワークファイルシステム)を構成する

2861 ワード

ホスト:Gentoo Linux 11.2
カーネル:Linux 3.0.6
オリジナル作品、転載は出典http://blog.csdn.net/yming0221/article/details/7200611
1、カーネルコンパイル構成
カーネルの構成をコンパイルするには、次のようにします.NFSサーバのサポートを選択します.
Gentoo Linux下配置NFS(网络文件系统)
Gentoo Linux下配置NFS(网络文件系统)
2、スペースソフトウェアの準備に用いる
コマンドnfs-utilsのインストール
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サービスを開始する
/etc/init.d/nfs start

開発ボードにホストディレクトリをマウントできました.
Gentoo Linux下配置NFS(网络文件系统)