ubuntu 16.04 配置 nfs 服务器、客户端

1. 下载和配置 nfs服务器

  • 下载
    apt-get install nfs-kernel-server
  • 配置
    gedit /etc/exports
/nfsdir *(rw,sync,no_root_squash,no_subtree_check)

ubuntu 16.04 配置 nfs 服务器、客户端_第1张图片
image.png

注: /nfsdir是作为共享目录

  • 重启 service nfs-kernel-server restart
  • 验证 showmount -e​
    image.png

2. 下载客户端

  • 下载
    apt-get install nfs-common
  • 查看
    showmount -e 192.168.0.200
    image.png
  • 使用
    手动挂载:
    mkdir /othernfsdir
    mount -t nfs -o nolock 192.168.0.200:/nfsdir /othernfsdir/
    自动挂载:
    gedit /etc/fstab
添加一行
...
192.168.0.200:/nfsdir /othernfsdir/ nfs rsize=8192,wsize=8192,timeo=14,intr

重启:reboot

你可能感兴趣的:(ubuntu 16.04 配置 nfs 服务器、客户端)