起動時にNFSマウントが失敗する

起動時にNFSマウントが失敗する

私は複数の Ubuntu サーバーを所有しており、最近、いくつかの 11.04 サーバー (および 1 つのデスクトップ) をインストールしましたが、再起動すると NFS マウントがマウントされないことがわかりました。

nfs-common を最新バージョンにアップグレードしてみましたが (1 つだけバージョンが遅れています)、エラーはわずかにしか変わりません。問題が発生しているサーバーはすべて、しばらく前に作成したサーバー テンプレートのクローン (vmWare) なので、テンプレートとそのクローンすべてに問題があるのではないかと思いました。次に、同じマウントをデスクトップ 11.04 で試しましたが、同じ問題が発生しました。約半分の時間で「S」を押してスキップできますが、残りの半分の時間でサーバーがフリーズします (最新のスナップショットから復元します)。また、奇妙なのは、午前システムに入ることができれば、「mount -a」を問題なく実行でき、すべてをマウントできます。このことから、NFS がマウントを試行するためにネットワークが存在するのを待っていないことが問題であると考えられます。また、そのホストが /etc/hosts にあるにもかかわらず、「ホストを解決できません」(NFS ポイント) エラーが発生することも、この問題を疑わせる要因です。

私の/var/log/boot.logは次の通りです

fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
/dev/sda1 was not cleanly unmounted, check forced.
/dev/mapper/php53x-root: clean, 75641/1032192 files, 492673/4126720 blocks (check in 5 mounts)
init: portmap-wait (statd) main process (373) killed by TERM signal
init: statd main process (402) terminated with status 1
init: statd main process ended, respawning
init: statd-mounting main process (355) killed by TERM signal
mount.nfs: Failed to resolve server NFSSERVER-priv: Name or service not known
init: statd-mounting main process (416) killed by TERM signal
mount.nfs: Failed to resolve server NFSSERVER-priv: Name or service not known
init: statd main process (435) terminated with status 1
init: statd main process ended, respawning
init: statd main process (459) terminated with status 1
init: statd main process ended, respawning
mountall: mount /var/www [410] terminated with status 32
mountall: mount /var/users [436] terminated with status 32
init: statd-mounting main process (448) killed by TERM signal
init: statd main process (468) terminated with status 1
init: statd main process ended, respawning
init: statd main process (498) terminated with status 1
init: statd main process ended, respawning
/dev/sda1: 226/124496 files (1.3% non-contiguous), 39133/248832 blocks
mountall: fsck /boot [268] terminated with status 1
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mountall: mount /var/users [583] terminated with status 32
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mountall: mount /var/www [575] terminated with status 32
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mountall: mount /var/www [638] terminated with status 32
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mountall: mount /var/users [645] terminated with status 32
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mountall: mount /var/www [724] terminated with status 32
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mountall: mount /var/users [729] terminated with status 32 Skipping /var/www at user request
 * Starting AppArmor profiles        [80G  [74G[ OK ]
 * Starting Name Service Cache Daemon nscd        [80G  [74G[ OK ]
FATAL: Module vmhgfs not found.
FATAL: Module vmsync not found.
FATAL: Module vmblock not found.
 * Loading open-vm-tools modules        [80G  [74G[ OK ]
 * Starting open-vm daemon vmtoolsd        [80G  [74G[ OK ]

長文になってしまい申し訳ありません。できるだけ多くの情報をお伝えしたかっただけです。これについて何かアドバイスはありますか? 一日中グーグルで検索し、_netdev や statd の設定変更を試してみましたが、何も機能しませんでした。影響を受けているサーバーは 6 台あります。:\

/etc/fstab: (問題のある行のみ - これらを削除すると、残りの nfs がマウントできるようになります)

NFSSERVER-priv:/vol/vol1_isp/eshowcase/sites      /var/www       nfs     ro,defaults        0       0
NFSSERVER-priv:/vol/vol1_isp/vusers      /var/users       nfs     defaults        0       0

/etc/hosts (関連エントリ):

10.1.1.43 NFSSERVER-priv

答え1

他の誰かがこの問題に遭遇し、ここで解決策を探している場合に備えて、回避策として私が行ったことを以下に示します。

/etc/init.d/ にスクリプト (mountall.sh) を作成しました:

#!/bin/bash

mount -r NFSSERVER-priv:/vol/vol1_isp/eshowcase/sites /var/www
mount    NFSSERVER-priv:/vol/vol1_isp/vusers          /var/users

システムに新しいスクリプトを認識させます。

update-rc.d mountall.sh defaults

オプション「defaults」は、実行レベル 2、3、4、5 で mountall.sh を起動するリンクを配置します。(また、実行レベル 0、1、6 で mountall.sh を停止するリンクを配置します。)

ファイルをchmodして実行可能にする

chmod +x mountall.sh

これで、init 6 を実行するとマウント ポイントが設定されます。また、最初に確認する場所がどこになるかわかるように、fstab に「コメント」を付けておくのも良いでしょう。

答え2

これがあなたに当てはまるかどうかはわかりませんが、問題は私が持っていました問題は、マウントしようとしていたディレクトリが起動時に利用できなかったことです。代わりにマウントを試みたら、/mntうまくいきました。

答え3

Ubuntu 14.04 を 14.10 にアップグレードした後、同じ問題が発生しました。私の場合は次の方法で問題を解決しました:

編集し/etc/default/nfs-commonて、次の内容であることを確認します:

NEED_STATD=yes

再起動後、NFS マウントが機能しました。

答え4

Windows 8 を使用している場合、NFS 形式のディスクはマウントされないことは確実です。この問題の解決策は、「Windows 8 を再度インストールし、設定で休止状態オプションを無効にする」ことです。そうすれば、NFS 形式のディスクをマウントできるようになります。

関連情報