Повторите попытку смонтировать общий ресурс NFS в случае неудачи

У меня есть общий ресурс NFS, который монтируется из / etc / fstab, так что он монтируется при загрузке. Но если общий ресурс NFS недоступен при загрузке, как я могу сделать так, чтобы он повторял попытки, пока не смог его смонтировать?

0
задан 24 September 2018 в 05:20
1 ответ

Параметр монтирования bg в / etc / fstab должен делать то, что вы просите:

от man nfs:

   bg / fg        Determines how the mount(8) command behaves if an attempt to mount an export fails.  The fg option causes mount(8) to exit with an error status if  any  part
                  of  the mount request times out or fails outright.  This is called a "foreground" mount, and is the default behavior if neither the fg nor bg mount option is
                  specified.

                  If the bg option is specified, a timeout or failure causes the mount(8) command to fork a child which continues to attempt to mount the export.   The  parent
                  immediately returns with a zero exit code.  This is known as a "background" mount.

                  If  the  local  mount  point  directory is missing, the mount(8) command acts as if the mount request timed out.  This permits nested NFS mounts specified in
                  /etc/fstab to proceed in any order during system initialization, even if some NFS servers are not yet available.  Alternatively these issues can be addressed
                  using an automounter (refer to automount(8) for details).
3
ответ дан 4 December 2019 в 12:16

Теги

Похожие вопросы