当 NFS 挂载消失时,Finder 会挂起

当 NFS 挂载消失时,Finder 会挂起

我通过 NFS 安装虚拟机的驱动器。我使用以下命令

sudo mount host:/home/path /home

将虚拟机上的路径挂载到我的/home目录(出于理智的原因,我这样做是为了匹配目录)。

问题是,当我关闭虚拟机而不卸载时,Finder 和大多数应用程序会挂起几分钟,直到操作系统意识到驱动器无法访问。

安装时有什么选项可以避免这种情况发生吗?

答案1

我认为您正在寻找软安装选项。不确定在 OSX 上是否如此,但它可能是 mount 命令上的“-s”标志。如果不是,根据, 你应该试试:

 This sets up a standard unix nfs mount, which is presumably what you want if 
 you are reading this. Note that you most likely need to run the Repair 
 Privileges utility first.

    Launch netinfo manager and authenticate
    select "mounts"
    from menubar: Directory>New Subdirectory (cmd-n)
       Enter the nfs mount path into the value field (eg tao:/home/tao/salathe.
       You can find correct root for the volume by typing df on another unix 
       system where the disk is mounted; it is the first column. You can add
       subdirectories to the path)

    from menubar: Directory->Append property enter "vfstype" in the property 
    field and "nfs" in the value(s) field.
       Append property dir with value of mounting point (eg /tao) this directory 
       must exist
    Append property opts with value -b (to background mount if it fails)
    Append value -P (NFS reserved port assignment)
    Append value -s (soft mount; mount process will fail after a certain number of tries)
    Should have something that looks like:

    Property      Value(s)
    vfstype       nfs
    dir           /tao
    name          tao:/home/tao/salathe
    opts          (-b, -P, -s)

    Save and quit
    Now you need to restart the nfs daemons. Find the pids and "kill -HUP" them. From the shell,

    % sudo -s
    % ps -aux | grep -E "nfsiod|automount"
    root      241   0.0  0.0     1276     84  ??  S      0:00.03 nfsiod -n 4
    root      242   0.0  0.0     1276     84  ??  S      0:00.00 nfsiod -n 4
    root      243   0.0  0.0     1276     84  ??  S      0:00.00 nfsiod -n 4
    root      244   0.0  0.0     1276     84  ??  S      0:00.00 nfsiod -n 4
    root      251   0.0  0.1     2392    440  ??  Ss     0:00.08 automount -m /Netwo
    root      413   0.0  0.0     1112    196 std  R+     0:00.00 grep -E nfsiod|auto
    % kill -HUP 241 242 243 244 251 [or whatever the pids]

    done!

    Note: Sometimes when the computer goes to sleep and wakes up, mounted 
    volumes are not fully accessible from Finder. They are still there at 
    command line. To fix this, use the "force quit" feature to restart Finder. 

相关内容