1. /etc/fstab实现
[root@client ~]# vim /etc/fstab
......
......
......
......
......
......
# 于最后行追加如下内容
nfssrv.1000cc.net:/mnt /mnt nfs defaults 0 0
2. autofs实现
[root@client ~]# yum install -y autofs
[root@client ~]# vim /etc/auto.master
......
......
......
......
......
......
# 于最后行追加如下内容
/- /etc/auto.mount
[root@client ~]# vim /etc/auto.mount
......
......
......
......
......
......
# 追加如下内容
/mnt -fstype=nfs,rw nfssrv.1000cc.net:/home
[root@client ~]# systemctl enable --now autofs
[root@client ~]# cat /proc/mounts | grep mnt
/etc/auto.mount /mnt autofs rw,relatime,fd=17,pgrp=1994,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=22472 0 0
|