LoginSignup
14
15

More than 5 years have passed since last update.

NFSサーバーを構築したメモ

Last updated at Posted at 2016-08-13

NFSサーバーを構築したメモ
今回は、
* サーバー Debian 8.5 (IPアドレス:192.168.1.100)
* クライアント Ubuntu14.04 (IPアドレス:192.168.1.200)

/home/server/foo を公開する

1. ホストの設定

まずはサーバーを以下のコマンドでインストール

Debian8.5
su
apt-get install nfs-kernel-server

次に

/etc/exports

に以下のように追記

# (公開したいディレクトリ) (どのマシンに公開するか)(公開モード)
/home/server/foo 192.168.1.200(rw,sync,no_subtree_check)

exports を編集したら以下のコマンドで再起動

/etc/init.d/nfs-kernel-server restart

2. クライアントの設定

最初にインストール

Ubuntu14.04
sudo apt-get install nfs-common

マウント先のディレクトリを作成しておく

mkdir /home/client/bar

今回はfstab でマウントします

/etc/fstab

に以下を追記

# (マウントしたいディレクトリ) (マウント先) nfs rw 0 0
192.168.1.100:/home/server/foo /home/client/bar nfs rw 0 0

ここで、クライアント側をリブート

クライアント側から、マウントできていれば完了です。お疲れ様でした。

14
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
15