Ubuntu 16.10: NFSクライアントのnfs-commonをインストールする


Table of Contents

1 nfs-commonのインストール

nfs-commonパッケージをインストールします。

$ sudo apt install -y nfs-common

2 mount.nfsでマウント

mount.nfsコマンドで/mntディレクトリへマウントします。

$ NFS_SERVER=nfs-server.hiroom2.com$ NFS_DIR=/var/lib/nfsshare$ sudo mount -t nfs ${NFS_SERVER}:${NFS_DIR} /mnt

3 起動時にマウント

他のファイルシステムと同様に/etc/fstabに追記します。ネットワーク初期化前にマウントするのを防ぐために、_netdevをオプションを指定する必要があります。x-systemd.automountにマウントさせるために、x-systemd.automountをオプションに指定する必要があります。

$ echo “${NFS_SERVER}:${NFS_DIR} /mnt nfs _netdev,x-systemd.automount 0 0” | sudo tee -a /etc/fstab

Android | Linux | SDL - Narrow Escape