我正在尝试将托管的 NFS 共享/data
挂载到server_host
也称为 的文件夹/data
中server_client
。我可以在启动时使用 fstab 文件安装它,并且可以使用sudo mount -t nfs server_host:/data /data
.因此,在 NFS 设置正确并且只需编辑两个配置文件的情况下,编辑几个 AutoFS 配置文件并使其正常工作应该很简单。但是,尽管遵循了我在网上找到的每个教程,但它不起作用。
这是我的auto.master
/- /etc/auto.master.d/data.dir
这是我的auto.master.d/data.dir
/data -fstype=nfs,rw server_host:/data
当我跑步时sudo automount -f -v -d
我得到
using kernel protocol version 5.05
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /-
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo--
lookup_nss_read_map: reading map file /etc/auto.master.d/data.dir
do_init: parse(sun): init gathered global options: (null)
mounted direct on /data with timeout 300, freq 75 seconds
do_mount_autofs_direct: mounted trigger /data
st_ready: st_ready(): state = 0 path /-
handle_packet: type = 5
handle_packet_missing_direct: token 39, name /data, request pid 608
attempting to mount entry /data
lookup_mount: lookup(file): looking up /data
lookup_mount: lookup(file): /data -> -fstype=nfs,rw server_host:/data
parse_mount: parse(sun): expanded entry: -fstype=nfs,rw server_host:/data
parse_mount: parse(sun): gathered options: fstype=nfs,rw
parse_mount: parse(sun): dequote("server_host:/data") -> server_host:/data
parse_mount: parse(sun): core of entry: options=fstype=nfs,rw, loc=server_host:/data
sun_mount: parse(sun): mounting root /data, mountpoint /data, what server_host:/data, fstype nfs, options rw
mount(nfs): root=/data name=/data what=server_host:/data, fstype=nfs, options=rw
mount(nfs): nfs options="rw", nobind=0, nosymlink=0, ro=0
get_nfs_info: called with host server_host(server_host) proto 6 version 0x20
get_nfs_info: error 0x0 getting getting portmap client
get_nfs_info: called with host server_host(server_host) proto 17 version 0x20
get_nfs_info: host not reachable or timed out getting service port
mount(nfs): no hosts available
dev_ioctl_send_fail: token = 39
**failed to mount /data**```