wiki:TipAndDoc/network/nfs

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.
    
  • 以下、効果が無かったもの
    • 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
      
    • 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
      
Last modified 9 years ago Last modified on Mar 21, 2016 2:48:29 AM

Attachments (1)

Download all attachments as: .zip