This topic describes how to troubleshoot issues that are introduced by soft mounts of NFS file systems on a Windows ECS instance.

Symptom

An NFS file system is mounted on a Windows ECS instance in the soft mode by default. However, in some scenarios, a soft mount introduces data inconsistency and abnormal exit of applications.
  • Data inconsistency: An error is returned if a request to access the soft-mounted file system times out. User applications do not get a response from the server, but the server may have already responded to the request. This causes data inconsistency.
  • Abnormal exit of applications: An error is returned if a request to access the soft-mounted file system times out. In this case, exceptions may occur if the applications are written in specific programming languages. If the exceptions are not handled, the applications will experience an abnormal exit.

Solution

To avoid these issues, you can mount an NFS file system on a Windows ECS instance in the hard mode.

  1. Run the mount command to view the mount mode.
    • If the command output includes mount=soft, perform step 2.
    • If the command output includes mount=hard, you do not need to perform the following steps.
  2. Stop the applications that are using the NFS file system.
  3. Run the following command to unmount the NFS file system.
    umount H:

    You need to replace the drive letter H: with a drive letter specific to your environment.

  4. Run the following command to remount the NFS file system.
    mount -o nolock -o mtype=hard -o timeout=60 \\xxxxxx.cn-hangzhou.nas.aliyuncs.com\! h:

    xxxxxx.cn-hangzhou.nas.aliyuncs.com is the endpoint of the mount target. h: is the mounted drive letter. You must replace the endpoint and drive letter based on your business requirements.

  5. Run the mount command to verify the mount result.
    The mount is successful if the command output includes mount=hard, locking=no, and timeout=10 (or a number greater than 10).