NFS客户端开机自启动

1.放在/etc/rc.local
chmod +x /etc/rc.local
echo "/bin/mount -t nfs 172.16.1.31:/data /mnt" >> /etc/rc.local
tail -2 /etc/rc.local

2.放在/etc/fstab(坑)
1.加载/etc/fstab
2.加载防火墙
3.加载网卡
添加以下内容
172.16.1.31:/data                        /mnt                     nfs     defaults        0 0
 开启延迟启动服务
systemctl enable remote-fs.target
reboot

3.在/etc/fstab 挂载的时候添加一个_netdev参数
172.16.1.31:/data                        /mnt                     nfs     defaults,_netdev        0 0
_netdev
      The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount
       these filesystems until the network has been enabled on the system).


分享到:
关键词:Linux运维

<< 上一篇

Linux之NFS配置

下一篇 >>

Inotify监测部署

网友留言(0 条)

发表评论