NFS サーバ

Debian LS-GL

唐突に

NFS サーバが必要になったので、内向きサーバの LS-GL をセットアップする。

パッケージ情報のアップデート

Get:1 http://ftp.jp.debian.org lenny Release.gpg [1032B]
Get:2 http://ftp.jp.debian.org lenny Release [73.6kB]
Ign http://ftp.jp.debian.org lenny/main Packages/DiffIndex
Ign http://ftp.jp.debian.org lenny/main Sources/DiffIndex
Get:3 http://ftp.jp.debian.org lenny/main Packages [5132kB]
Get:4 http://security.debian.org lenny/updates Release.gpg [835B]
Get:5 http://security.debian.org lenny/updates Release [40.8kB]
Get:6 http://ftp.jp.debian.org lenny/main Sources [2307kB]
Ign http://security.debian.org lenny/updates/main Packages/DiffIndex
Ign http://security.debian.org lenny/updates/main Sources/DiffIndex
Get:7 http://security.debian.org lenny/updates/main Packages [212kB]
Get:8 http://security.debian.org lenny/updates/main Sources [57.2kB]
Fetched 7825kB in 44s (175kB/s)
Reading package lists... Done
ude:~# 

パッケージを探す

ude:~# apt-cache search NFS
	:
	:
nfs-common - NFS support files common to client and server
nfs-kernel-server - support for NFS kernel server
nfs-user-server - User space NFS server
	:
	:
ude:~#
このあたりか

パッケージのインストール

nfs-kernel-server をインストールする。
ude:~# apt-get install nfs-kernel-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libevent1 libgssglue1 libnfsidmap2 librpcsecgss3 nfs-common portmap
The following NEW packages will be installed:
  libevent1 libgssglue1 libnfsidmap2 librpcsecgss3 nfs-common
  nfs-kernel-server portmap
0 upgraded, 7 newly installed, 0 to remove and 25 not upgraded.
Need to get 493kB of archives.
After this operation, 1491kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org lenny/main libevent1 1.3e-3 [42.3kB]
Get:2 http://ftp.jp.debian.org lenny/main libgssglue1 0.1-2 [21.0kB]
Get:3 http://ftp.jp.debian.org lenny/main libnfsidmap2 0.20-1 [22.4kB]
Get:4 http://ftp.jp.debian.org lenny/main librpcsecgss3 0.18-1 [33.4kB]
Get:5 http://ftp.jp.debian.org lenny/main portmap 6.0-9 [36.0kB]
Get:6 http://ftp.jp.debian.org lenny/main nfs-common 1:1.1.2-6lenny1 [189kB]
Get:7 http://ftp.jp.debian.org lenny/main nfs-kernel-server 1:1.1.2-6lenny1 [148kB]
Fetched 493kB in 2s (172kB/s)
Preconfiguring packages ...
Selecting previously deselected package libevent1.
(Reading database ... 10157 files and directories currently installed.)
Unpacking libevent1 (from .../libevent1_1.3e-3_armel.deb) ...
Selecting previously deselected package libgssglue1.
Unpacking libgssglue1 (from .../libgssglue1_0.1-2_armel.deb) ...
Selecting previously deselected package libnfsidmap2.
Unpacking libnfsidmap2 (from .../libnfsidmap2_0.20-1_armel.deb) ...
Selecting previously deselected package librpcsecgss3.
Unpacking librpcsecgss3 (from .../librpcsecgss3_0.18-1_armel.deb) ...
Selecting previously deselected package portmap.
Unpacking portmap (from .../portmap_6.0-9_armel.deb) ...
Selecting previously deselected package nfs-common.
Unpacking nfs-common (from .../nfs-common_1%3a1.1.2-6lenny1_armel.deb) ...
Selecting previously deselected package nfs-kernel-server.
Unpacking nfs-kernel-server (from .../nfs-kernel-server_1%3a1.1.2-6lenny1_armel.deb) ...
Processing triggers for man-db ...
Setting up libevent1 (1.3e-3) ...
Setting up libgssglue1 (0.1-2) ...
Setting up libnfsidmap2 (0.20-1) ...
Setting up librpcsecgss3 (0.18-1) ...
Setting up portmap (6.0-9) ...
Starting portmap daemon....
Setting up nfs-common (1:1.1.2-6lenny1) ...

Creating config file /etc/idmapd.conf with new version

Creating config file /etc/default/nfs-common with new version
Adding system user `statd' (UID 103) ...
Adding new user `statd' (UID 103) with group `nogroup' ...
Not creating home directory `/var/lib/nfs'.
Starting NFS common utilities: statd.
Setting up nfs-kernel-server (1:1.1.2-6lenny1) ...

Creating config file /etc/exports with new version

Creating config file /etc/default/nfs-kernel-server with new version
Starting NFS common utilities: statd.
Not starting NFS kernel daemon: no support in current kernel. (warning).
ude:~#

公開ディレクトリの作成

/srv/nfs を NFS で公開することにする
ude:~# ls /srv/
tftp
ude:~# mkdir /srv/nfs
ude:~#

/etc/exports の作成

ude:/etc# mv exports exports.orig
ude:/etc# cp exports.orig exports
ude:/etc# vi exports
	:
	:
ude:/etc# diff -c exports.orig exports
*** exports.orig        Tue Oct 21 14:11:59 2008
--- exports     Sat Oct  3 07:28:28 2009
***************
*** 8,10 ****
--- 8,11 ----
  # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
  # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
  #
+ /srv/nfs      *(rw,sync,no_root_squash)
ude:/etc#
こんなものか?

/etc/exports の反映

ude:/etc# /etc/init.d/nfs-kernel-server reload
Re-exporting directories for NFS kernel daemon...exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/srv/nfs".
  Assuming default behaviour ('no_subtree_check').
  NOTE: this default has changed since nfs-utils version 1.0.x

.
ude:/etc#

NFS サーバ、できあがり?



LS-GL
バッファローダイレクト
楽天市場
Amazon
Yahoo!ショッピング
livedoor デパート
ドスパラ


ファームウェア 1.21 でハックキット
ハックの記録
LinkStation/玄箱 をハックしよう

NFS サーバ(2)

Copyright (C) 2003-2009 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市