[[PageOutline]] * [http://itmst.blog71.fc2.com/blog-entry-89.html Electronic Genome - Ubuntu + NFSサーバでファイル共有] * 良くまとまっているので、このページのみでほぼ構成できた。 * [http://masaoo.blogspot.com/2009/08/ubuntu-nfs.html まさおのブログ (表): Ubuntu で NFS サーバの設定をする] * [http://fragments.g.hatena.ne.jp/hogem/20080924/1222266324 nfsのmountオプション - うまい棒の断片 - 断片部] * [http://stackoverflow.com/questions/2680917/whats-sure-kill-when-talking-about-nfs-mount-option what's "sure kill" when talking about NFS mount option? - Stack Overflow] > I think it means kill -9, though please note that you are reading a quite old howto (as most other TLDP howtos, I think) from 2002 year, and regarding NFS mount options hard,intr are already default and >> The intr / nointr mount option is deprecated after kernel 2.6.25. Only SIGKILL can interrupt a pending NFS operation on these kernels, and if specified, this mount option is ignored to provide backwards compatibility with older kernels. * [http://archive.linux.or.jp/JF/JFdocs/NFS-HOWTO/performance.html NFS の性能を最適化する] * [http://www.asahi-net.or.jp/~aa4t-nngk/nfs.html Stray Penguin - Linux Memo (NFS)] * [http://www.asahi-net.or.jp/~aa4t-nngk/nfsv4.html Stray Penguin - Linux Memo (NFSv4)] * [http://wiki.debian.org/SecuringNFS SecuringNFS - Debian Wiki] * [http://serverfault.com/questions/83991/nfs-export-of-other-mounts-in-the-tree redhat - NFS export of other mounts in the tree - Server Fault] * 次のようなエラーが出る {{{ request to export directory /var/samba/mnt below nearest filesystem /var/samba }}} * nohide = NFSv4 = * [http://linux.die.net/man/5/exports exports(5): NFS server export table - Linux man page] > For NFSv4, there is a distinguished filesystem which is the root of all exported filesystem. This is specified with fsid=root or fsid=0 both of which mean exactly the same thing. * [http://www.asahi-net.or.jp/~aa4t-nngk/nfsv4.html Stray Penguin - Linux Memo (NFSv4)] = NFS with DHCP = * 結果として、静的割当を行わないと起動時のマウントには成功しなかった * Linux 4.4.5-1-ARCH * nfs-utils 1.3.3-3 * nfs-server:~$ cat /etc/exports {{{ /srv/nfs4 192.168.1.0/24(rw,sync,fsid=0,no_subtree_check,no_root_squash) }}} * nfs-client:~$ cat /etc/fstab {{{ nfs-server.local.mitty.jp:/ /srv/nfs4 nfs4 nosuid,noexec,_netdev,hard 0 0 }}} * mitty@nfs-client:~$ systemctl status srv-nfs4.mount {{{ ● srv-nfs4.mount - /srv/nfs4 Loaded: loaded (/etc/fstab; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Tue 2016-03-15 00:20:17 JST; 7min ago Where: /srv/nfs4 What: nfs-server.local.mitty.jp:/ Docs: man:fstab(5) man:systemd-fstab-generator(8) Mar 15 00:20:17 nfs-client systemd[1]: Mounting /srv/nfs4... Mar 15 00:20:17 nfs-client mount[229]: mount.nfs4: Failed to resolve server nfs-server.local.mitty.jp: Name or service not known Mar 15 00:20:17 nfs-client systemd[1]: srv-nfs4.mount: Mount process exited, code=exited status=32 Mar 15 00:20:17 nfs-client systemd[1]: Failed to mount /srv/nfs4. Mar 15 00:20:17 nfs-client systemd[1]: srv-nfs4.mount: Unit entered failed state. }}} * [[Image(nfs-dhcp.png,33%)]] * 以下、効果が無かったもの * rpcbind.service, nfs-client.serviceの有効化 {{{ mitty@nfs-client:~$ sudo systemctl enable rpcbind.service Created symlink from /etc/systemd/system/sockets.target.wants/rpcbind.socket to /usr/lib/systemd/system/rpcbind.socket. mitty@nfs-client:~$ sudo systemctl enable nfs-client.target Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-client.target to /usr/lib/systemd/system/nfs-client.target. Created symlink from /etc/systemd/system/remote-fs.target.wants/nfs-client.target to /usr/lib/systemd/system/nfs-client.target. mitty@nfs-client:~$ sudo systemctl enable remote-fs.target }}} * [http://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html Linux tip: Force systemd networkd to wait for DHCP | @Blog("Baptiste Wicht")] {{{ mitty@nfs-client:~$ sudo vim /etc/systemd/system/multi-user.target.wants/remote-fs.target Wants=network-online.target After=remote-fs-pre.target network-online.target mitty@nfs-client:~$ sudo systemctl enable systemd-networkd-wait-online.service Created symlink from /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service to /usr/lib/systemd/system/systemd-networkd-wait-online.service. }}} {{{ Wants=dhcpcd.service After=remote-fs-pre.target dhcpcd.service }}}