Which operating systems and file system protocols are supported by the mount feature?

You can mount NFS file systems on Linux or Windows. You can also mount SMB file systems on Linux or Windows. To mount a file system on a Windows or Linux Elastic Compute Service (ECS) instance, log on to the ECS instance and run a mount command. For more information, see Mount an SMB file system on Windows, Mount an NFS file system on a Windows ECS instance, and Mount an SMB file system on a Linux ECS instance.

How do I mount a file system on an ECS instance that resides in the classic network or a VPC by using the NAS console?

Go to the Cloud Assistant page in the ECS console and follow the instructions to mount the file system. For more information, see Mount a NAS file system on multiple ECS instances at the same time.

Why am I unable to mount a file system by using the NAS console?

The following table describes the possible causes of mount failures and the solutions.
Issue Cause Solution
The status of the ECS instance or the Cloud Assistant client is abnormal. The ECS instance is not running. In the ECS console, check the status of the ECS instance and resolve the issue.
The Cloud Assistant client is not installed. Install the Cloud Assistant client. For more information, see Install the client on Linux instances by using the RPM package.
The execution of the mount command times out or is interrupted. The time required to install the NFS client is longer than expected. Wait for a few minutes and then run the mount command again.
The NFS client fails to be installed. The source of the NFS client fails to be identified. Log on to the ECS instance and install the NFS client. For more information, see Install an NFS client.
The format of the values specified for request parameters is invalid. The specified mount path or the directory of the NAS file system is invalid. Make sure that the specified mount path or the directory of the NAS file system is an absolute path. You can use the default values for optional parameters.
The mount path does not meet requirements. The mount path is not empty. Change the mount path and mount the file system again.
Another mount target is mounted on the mount path.
Another mount target is mounted on the parent directory of the mount path.
The mount command is invalid. The values of one or more mount parameters are invalid. We recommend that you use the default values for the mount parameters and mount the file system again.
Other causes Run the troubleshooting script to resolve the issue. For more information, see Fix mount issues.

What happens if I forcibly unmount a NAS file system?

If you forcibly unmount a NAS file system, in-memory data may fail to be saved to the disk and related applications may unexpectedly exit. To prevent these issues, we recommend that you perform the following steps to unmount a NAS file system: Log on to the ECS instance and run a command that follows the fuser -mv <Mount path> syntax to check the processes that are connected to the file system. Stop all these processes except the mount process. Then, unmount the file system.

If a NAS file system to which no processes are connected fails to be unmounted, you can forcibly unmount the NAS file system. After you forcibly unmount a NAS file system, some temporary files may exist in the kernel. You must restart the ECS instance to remove the files. Otherwise, you may be unable to mount the NAS file system again.

How do I configure the mount parameters when I use the mount feature in the NAS console?

In the NAS console, optimal default values are specified for the mount parameters of the NAS file system that you want to mount based on the protocol version and the type of the NAS file system. If you do not have special requirements, we recommend that you use the default values of the mount parameters. If you change the default values, you may be unable to mount the file system.

If you want to change the default values of some mount parameters based on your business requirements, see Mount parameters. You can also submit a ticket to contact the technical support team of NAS.

Why am I unable to view the ECS instance that I created in the ECS instance list when I mount a file system in the NAS console?

We recommend that you refresh the page on which the ECS instance list is displayed. Then, you can run the mount command again and check whether the ECS instance is displayed.

Why does the new protocol type or the new value of a mount parameter not take effect when I use the mount feature?

If the specified mount target is mounted on the mount path, the new protocol type and the new value of a mount parameter are ignored. You must unmount the file system from the mount path before you can use the new protocol type and the new value of the mount parameter to mount the file system again.

Which operating systems and file system protocols are supported by the batch mount feature?

You can mount NFS file systems on Linux or Windows. You can also mount SMB file systems on Linux or Windows. To mount a file system on a Windows or Linux Elastic Compute Service (ECS) instance, log on to the ECS instance and run a mount command. For more information, see Mount an SMB file system on Windows, Mount an NFS file system on a Windows ECS instance, and Mount an SMB file system on a Linux ECS instance.

Which mount options are supported by the batch mount feature?

You can mount a file system on a host in the classic network. You can also mount a file system across multiple VPCs that reside in the same region. You cannot mount a file system across multiple regions. Even if two VPCs that reside in different regions are connected, you still cannot mount a file system across the VPCs.

Can I use the batch mount feature to mount a file system on a host in a self-managed data center?

No, you cannot attach multiple storage plans to a file system. If you want to mount a file system on a host in a self-managed data center, you must configure a VPN gateway or a NAT gateway. For more information, see Access a NAS file system from a data center by using NAT Gateway or Access an Apsara File Storage NAS file system from a local data center by using VPN Gateway.

How do I check the output of a batch mount or batch unmount command?

To check the output of a batch mount or batch unmount command, perform the following steps: Log on to the ECS console and choose Maintenance & Monitoring > ECS Cloud Assistant. On the Command Execution Result tab of the Cloud Assistant page, you can view all tasks that are in the Task Failed, Successful, or Partially Failed state. To query the execution result of a task that you run on each ECS instance, you can click View in the Actions column of the task.

How do I view the mount information on the Cloud Assistant page after I mount multiple file systems on an ECS instance at the same time?

Perform the following steps: Log on to the NAS console. Go to the details page of the file system that you want to manage. On the Mounting Use tab, find the mount target that you want to manage and click Query in the Actions column to view the mount information about the corresponding ECS instance. For more information, see Mount a file system on an ECS instance by using the NAS console.

How do I change the default value of a mount parameter based on my business scenario?

In most cases, you can use the default values for mount parameters. You can leave the mountparam parameter empty. If you want to configure specific mount parameters, you must configure all mount parameters in the mountparam parameter. You must configure noresvport and specify vers=3 or vers=4,minorversion=0. If you set the mountparam parameter to a custom value when you run the mount script, the value of the protocoltype parameter is ignored by the mount script. For more information, see Parameters.

Why does the new protocol type or the new value of a mount parameter not take effect when I use the batch mount feature?

If the specified mount target is mounted on the mount path, the new protocol type and the new value of a mount parameter are ignored. You must unmount the file system from the mount path before you can use the new protocol type and the new value of the mount parameter to mount the file system again.

What do I do if I cannot batch mount file systems, batch unmount file systems, or query the mount information about an ECS instance by using Cloud Assistant?

Make sure that the values that are specified for mount parameters are valid. Troubleshoot the issue based on the error code that is returned in the command output. For more information, see Error messages. Attempt to mount a file system on an ECS instance and check the result. If the mount still fails, troubleshoot the issue based on the returned error message.

You can mount a file system on an ECS instance in the NAS console. If the mount still fails, troubleshoot the issue based on the returned error message.

How do I change the maximum number of concurrent NFS requests from an NFS client?

By default, the maximum number of concurrent requests from a Network File System (NFS) agent is 2. This affects the performance of NFS file systems. We recommend that you set the maximum number to 128.

  • Method 1
    1. Install an NFS client. For more information, see Install an NFS client.
    2. Run the following commands to set the maximum number of concurrent NFS requests to 128:
      echo "options sunrpc tcp_slot_table_entries=128" >> /etc/modprobe.d/sunrpc.conf
      echo "options sunrpc tcp_max_slot_table_entries=128" >>  /etc/modprobe.d/sunrpc.conf
      Note The first time you install an NFS agent, run the preceding commands with root permissions. After you run the preceding commands, you do not need to run the commands again.
    3. Run the following command to restart the ECS instance:
      reboot
    4. Mount the file system. For more information, see Mount an NFS file system on a Linux ECS instance.
    5. Run the following command to check the result.
      If the value 128 is returned, the maximum number is changed.
      cat /proc/sys/sunrpc/tcp_slot_table_entries
  • Method 2
    1. Install an NFS client. For more information, see Install an NFS client.
    2. Run the following commands to set the maximum number of concurrent NFS requests to 128:
      echo "options sunrpc tcp_slot_table_entries=128" >> /etc/modprobe.d/sunrpc.conf
      echo "options sunrpc tcp_max_slot_table_entries=128" >>  /etc/modprobe.d/sunrpc.conf
      Note The first time you install an NFS agent, run the preceding commands with root permissions. After you run the preceding commands, you do not need to run the commands again.
    3. Remount the file system. For more information, see Mount an NFS file system on a Linux ECS instance.
    4. Run the following command to check the result.
      If the value 128 is returned, the maximum number is changed.
      cat /proc/sys/sunrpc/tcp_slot_table_entries

How do I create and mount a subdirectory of a NAS file system on Linux?

Make sure that a file system is mounted. For more information, see Mount an NFS file system on a Linux ECS instance.

If you mount the /mnt directory of the file system on a Linux ECS instance, the /mnt directory is used as the root directory of the file system. You can create subdirectories in the /mnt directory.

  1. Create a subdirectory in the root directory of the NAS file system on the Linux ECS instance.
    mkdir /mnt/subdir
  2. Create a local directory on which you want to mount the NAS file system.
    mkdir /tmp/mnt
    Note After you create a local directory on a server, you can mount only one file system on the local directory. If you want to mount multiple file systems, you must create multiple local directories.
  3. Remount the file system.
    sudo mount -t nfs -o vers=3,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,file-system-id.region.nas.aliyuncs.com:/subdir /tmp/mnt
    The following list describes the required fields. Replace the values of these fields with the actual values.
    • file-system-id.region.nas.aliyuncs.com: specifies the endpoint of the mount target. To obtain the mount target, perform the following steps: Log on to the NAS console. On the File System List page, click the name of the file system. On the details page, click Mounting Use and copy the mount command.
    • /subdir: specifies the subdirectory of the NAS file system.
    • /tmp/mnt: specifies the local directory of the server.

How do I resolve the issues that occur after I accidentally delete a mount target on an ECS instance that runs Linux?

  • Issue

    A file system is mounted on a Linux ECS instance by using Mount Target A. However, the mount target is deleted from the NAS console before the file system is unmounted. As a result, issues occur on Linux. For example, the system responds slowly or does not respond when you run commands.

  • Solution
    1. Log on to the Linux ECS instance and press Ctrl+C to stop the commands that are being run.
    2. Run the mount command to view the mount information.
      Obtain the mount directory from the mount information, Obtain the mount directory from the mount information, for example, /mnt/data, as shown in the following figure. View the mount information
    3. Run the umount -f /mnt/data command to unmount the file system.
      Command syntax: unmount-f <Mount directory>
      Note If the file system fails to be unmounted by using the unmount -f <Mount directory> command, run the umount -l <Mount directory> command.
      After you unmount the file system, you can create a mount target to remount the file system.

How do I prevent the listening port of a file system that supports NFSv4.0 protocol from being considered as a Trojan horse?

  • Issue

    After you mount a file system that supports the NFSv4.0 protocol on a compute node, a random listening port of 0.0.0.0 is listened to by using the protocol. The netstat command cannot identify the process of the listening port.

    The listening port is a random port. Therefore, the backend application of the listening port cannot be identified. As a result, the listening port is considered as a Trojan horse.NFSv4.0

  • Cause

    The NFSv4.0 protocol is used to listen to the random port for callback operations. The default value of the fs.nfs.nfs_callback_tcpport kernel parameter is 0. Therefore, the NFSv4.0 protocol is used to listen to a random port. This random port does not cause security risks.

  • Solution
    Before you mount the file system, specify a non-zero value for the fs.nfs.nfs_callback_tcpport parameter. The non-zero value is used as the port number of the callback port.
    sudo sysctl fs.nfs.nfs_callback_tcpport=<port>          

    In the following example, the fs.nfs.nfs_callback_tcpport parameter is set to 45450. After you mount a file system that supports the NFSv4.0 protocol, the output of the netstat command indicates that the system listens to port 45450. The root user is used in this example, as shown in the following figure. Therefore, you do not need to use sudo to run the sysctl command. 45450

Why am I unable to use a Linux client to read data from or write data to files whose names contain Chinese characters in a file system?

The files whose names contain Chinese characters in a file system are created on a Windows client. The names of the files are encoded in the GBK format. By default, Linux clients can recognize only file names that are encoded in the UTF-8 format. Therefore, Linux clients cannot recognize files whose names contain Chinese characters. We recommend that you use a Windows client to read data from and write data to the files whose names contain Chinese characters.

What do I do if a 523 error is returned when I run the ls command on a Linux client on which an NFS file system is mounted?

  • Issue
    The following error message is returned when you run the ls command on a Linux client on which an NFS file system is mounted: 29
  • Cause

    If you run the ls command on a directory of a file system when multiple rename operations are concurrently performed, a 523 error occurs.

  • Solution

    Try again later. If the issue persists, submit a ticket.

What do I do if the "mount.nfs: No such device" error message is returned when I mount an NFS file system?

  • Issue
    When you mount a NAS NFS file system on an ECS instance, the following error message appears:
    mount.nfs: No such device
    No such device
  • Cause

    When the options sunrpc tcp_slot_table_entries=128 setting in the /etc/modprobe.d/sunrpc.conf file is changed to options sunrpc tcp_slot_entries=128, this issue may occur if the system fails to load the sunrpc module to the kernel.

  • Solution
    1. Change the options sunrpc tcp_slot_entries=128 setting in the /etc/modprobe.d/sunrpc.conf file to options sunrpc tcp_slot_table_entries=128.
    2. Run the modprobe sunrpc command to load the sunrpc module.
    3. Remount the NFS file system.

How do I fix the error that occurs when I mount an SMB file system on Windows?

  1. System error 53
    • Error description

      The network path is not found.

    • Cause
      • The network connection fails.
      • The TCP/IP NetBIOS Helper service is not started.
      • LanmanWorkstation is not specified in the registry.
    • Solution
      1. Run the ping <Endpoint of a mount target> command to check whether the endpoint of a mount target can be accessed and whether the latency is within the expected range.
        • If the endpoint of the mount target can be pinged, go to Step 2.
        • Otherwise, perform the following steps:
          • Verify that the mount command is valid. Make sure that the command does not include redundant forward slashes (/), backslashes (\), spaces, or myshare.
            To run a valid command to mount an SMB file system, use the following syntax:
            net use <Letter of the destination drive> \\<Endpoint of a mount target>\myshare
            Example:
            net use z: \\xxxx.cn-hangzhou.nas.aliyuncs.com\myshare 
          • Make sure that the protocol type of the file system is SMB. SMB
          • Make sure that the endpoint of the mount target is valid.
          • Make sure that the Elastic Compute Service (ECS) instance and the mount target reside in the same virtual private cloud (VPC).
          • If the ECS instance and the mount target do not reside in the same VPC, make sure that the VPC or virtual private network (VPN) configurations of the ECS instance are valid.
      2. Run the telnet <Endpoint of a mount target> 445 command to check whether the SMB protocol is enabled.
      3. Check whether the TCP/IP NetBIOS Helper service is started. For more information, see Mount an SMB file system on Windows.
      4. Open the Registry Editor and choose HKEY_LOCAL_MACHINE > System > CurrentControlSet > Control > NetworkProvider > Order. In the dialog box that appears, check whether the ProviderOrder key contains the LanmanWorkstation value. If the ProviderOrder key does not contain the LanmanWorkstation value, add the value to the ProviderOrder key.
  2. System error 58
    • Error description

      The specified server cannot perform the requested operation.

    • Cause

      The Windows operating system that the ECS instance runs is incompatible with the SMB protocol that is used by the file system.

    • Solution

      Make sure that the ECS instance runs Windows Server 2008 R2 or a later version except Windows Server 2008.

  3. System error 64
    • Error description

      The specified network name is unavailable.

    • Cause
      • The IP address of the ECS instance is not included in the permission groups of the NAS file system.
      • The internal IP address or VPC IP address of the ECS instance is not included in the permission groups of the NAS file system.
      • Your Alibaba Cloud account has overdue payments.
      • The ECS instance and the NAS file system reside in the classic network, but belong to different Alibaba Cloud accounts.
      • The protocol type of the file system is not SMB.
    • Solution
      This error occurs because the NAS file system cannot be accessed. Perform the following steps to fix the error:
      1. Make sure that the internal IP address or VPC IP address of the ECS instance is included in the permission groups of the NAS file system.
      2. Make sure that your Alibaba Cloud account does not have overdue payments.
      3. If the ECS instance and the NAS file system reside in the classic network, make sure that they belong to the same Alibaba Cloud account.
      4. Make sure that the protocol type of the file system is SMB. System error 64
  4. System error 67
    • Error description

      The network name cannot be found.

    • Cause

      The required network services are not started.

    • Solution
      Start the following services. For more information, see Mount an SMB file system on Windows.
      1. The Workstation service.
      2. The TCP/IP NetBIOS Helper service.
  5. System error 85
    • Error description

      The local device name is already in use.

    • Cause

      The specified drive letter is already in use.

    • Solution

      Change the drive letter and remount the file system.

  6. System error 1231
    • Error description

      The network location is unavailable.

    • Cause
      • The Client for Microsoft Networks component is uninstalled or disabled.
      • The File and Printer Sharing for Microsoft Networks component is uninstalled or disabled.
    • Solution

      Install and enable the Client for Microsoft Networks component or the File and Printer Sharing for Microsoft Networks component.

      If the Client for Microsoft Networks component or the File and Printer Sharing for Microsoft Networks component is installed but not enabled, select the Client for Microsoft Networks option or the File and Printer Sharing for Microsoft Networks option. To install and enable the component, perform the following steps:

      1. On the Network and Sharing Center page, click the active network connection.
      2. Click Properties.
      3. In the WLAN Properties dialog box, click Install.
        • Install the Client for Microsoft Networks component.
          1. In the Select Network Feature Type dialog box, select Client and click Add.
          2. Select Client for Microsoft Networks and click OK.
        • Install the File and Printer Sharing for Microsoft Networks component.
          1. In the Select Network Feature Type dialog box, select Service and click Add.
          2. Choose Microsoft > File and Printer Sharing for Microsoft and click OK.
  7. System error 1272
    • Error description

      You cannot access this shared folder because the security policies of your organization block access from unauthorized guests. These policies protect your PC from suspicious or unauthorized devices on the network.

    • Cause

      The security policies of the Windows operating system block access from guest users to the SMB file system.

    • Solution
      If the ECS instance runs a Windows operating system that is later than Windows Server 2016, configure the following registry to allow access from guest users:
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
      "AllowInsecureGuestAuth"=dword:1
      For more information, see Guest access in SMB2 disabled by default in Windows.

Why does a file in a NAS file system belong to different owners when I query the file on two ECS instances?

In NAS file systems, users are identified by User Identifiers (UIDs) or Group Identifiers (GIDs) instead of user names. The owner name of a file that you query on an ECS instance is converted from a UID. If a UID is converted into different user names on different ECS instances, the UID is identified as a different owner on each ECS instance.

For example, create a file named admin_on_machine1 on ECS Instance 1 and a file named admin_on_machine2 on ECS Instance 2 as the admin user. Run the ls -l command on ECS Instance 1 to view the created file, as shown in the following figure.faq001Run the ls -l command on ECS Instance 2 to view the created file, as shown in the following figure.faq002The query results on the two ECS instances indicate that the same file has different owner names.
Run the id command on the two ECS instances to query the information about the admin user. The UID of the admin user on ECS Instance 1 is 505, as shown in the following figure.faq04The UID of the admin user on ECS Instance 2 is 2915, as shown in the following figure.faq005Run the stat admin_on_machine1 admin_on_machine2 command, as shown in the following figure. The results indicate that the two files belong to two different UIDs.faq

Why am I unable to mount an SMB file system on a Windows operating system that is later than Windows Server 2016?

  • Issue

    An error occurs when you run the following command:

    C:\Users\Administrator>net use z: \\xxxxx-xxxx.xxxxx.nas.aliyuncs.com\myshare
    System error 1272 has occurred.
    You can't access this shared folder because your organization's security policies block unauthenticated guest access. These policies help protect your PC from unsafe or malicious devices on the network.
  • Solution

    This error occurs because the security policies of Windows operating systems that are later than Windows Server 2016 do not allow guest users to access remote shared directories.

    Perform the following steps to fix the error:

    • Find the following registry key:
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
      "AllowInsecureGuestAuth"=dword:0

      Modify the key.

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
      "AllowInsecureGuestAuth"=dword:1
    • Open PowerShell and run the following command:
      New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force

    For more information, see Guest access in SMB2 disabled by default in Windows 10, Windows Server 2016 version 1709, and Windows Server 2019.

Why am I unable to mount an SMB file system?

  • Issue

    The net use command is used to mount SMB file systems. If you accidentally use the command to mount NFS file systems, you can no longer use the command to mount an SMB file system.

  • Solution

    Make sure that the protocol of the file system is SMB. Then, stop the mount operation and attempt to mount the file system again in 5 minutes. If the issue persists, submit a ticket.

Why is a mounted SMB directory visible only to an administrator?

Windows user accounts are isolated from each other. For example, if you log on to Windows as User A, you cannot view the directory that you mounted as User B.

If you want to allow multiple users to share data, create a shared directory. For example, you can run the following command to create a shared directory named myshare on drive C:
mklink /D C:\myshare \\xxxxxxx-xxxx.cn-beijing.nas.aliyuncs.com\myshare\

Why is Internet Information Services (IIS) unable to load the files of an SMB volume on Windows Server 2016?

For more information about how to resolve this issue, see Install and configure Active Directory domains.

How do I fix the error that occurs when I use IIS to access a NAS file system?

When you mount an SMB file system on Windows Server 2016, an HTTP error 500.19 (error code 0x8007003a) occurs. For information about how to fix this error, see Best practices for using IIS to access a NAS file system.

Can I mount an NFS file system and an SMB file system on the same ECS instance?

No, you cannot mount an NFS file system and an SMB file system on the same ECS instance.

To prevent compatibility issues, we recommend that you do not access an SMB file system by using a Linux client. For example, Windows and Linux support different character sets and have different limits on the length of file names. In Windows, a file name can contain up to 255 wide characters encoded in the Unicode format. In Linux, a file name can contain up to 255 characters encoded in the UTF-8 format.

If you want to mount an NFS file system and an SMB file system on the same ECS instance, you can mount the SMB file system on a Linux ECS instance. The kernel of the Linux ECS instance must support SMBv2 or a later version.

Run the mount -t cifs -o vers=2.0 \\<Mount target>\myshare /mnt or mount -t cifs -o vers=2.0 //<Mount target>/myshare /mnt command.
Note If you are prompted to enter a password after you run the commands, press Enter.

To check whether your Linux kernel supports the CIFS protocol, view the value of CONFIG_CIFS in the /boot directory. A value of y or m indicates that the protocol is supported and a CIFS file system can be mounted.

CIFS
Note
  • Before you run the preceding command, you must install the cifs-utils tool. For example, you can run the following command to install the cifs-utils tool on CentOS:
    yum install samba-client samba-common cifs-utils
  • If the kernel version of your Linux operating system does not support the CIFS protocol, we recommend that you upgrade the Linux kernel to version 3.10.0-514 or later.

Why am I unable to mount an SMB file system on Linux?

Cause
  • You are using an early or incompatible version of Linux distributions. SMB file systems support the following Linux distributions:
    • CentOS 7.6 64-bit (3.10.0-957.5.1.el7.x86_64)
    • Ubuntu 18.04 64-bit (4.15.0-48-generic)
    • Debian 9.9 64-bit (4.9.0-9-amd64)
    • SUSE Enterprise Server 12 SP2 64-bit (4.4.74-92.35-default)
    • openSUSE 42.3 64-bit (4.4.90-28-default)
    • Alibaba Cloud Linux (4.19.34-11.al7.x86_64)
    • CoreOS (4.19.43-coreos VersionID=2079.4.0)
  • The cifs-utils tool is not installed on the client, or the executable file of the mount.cifs command is stored in a directory that is different from the directory specified by the PATH environment variable.
  • No network connection is established between the Linux ECS instance and the SMB file system.
    • The Linux ECS instance and the SMB file system belong to different Alibaba Cloud accounts.
    • The Linux ECS instance and the SMB file system reside in different regions.
    • The Linux ECS instance and the SMB file system reside in different networks. For example, the Linux ECS instance and the SMB file system reside in different VPCs, or one of them resides in a VPC and the other resides in the classic network.
      Note You can mount a NAS file system on an on-premises Linux client. If you cannot access the file system from the Linux client, a possible cause is that no network connection is established between the Linux client and the file system. You can use Express Connect to establish a network connection before the Linux client and the file system.
    • The IP address of the Linux ECS instance is not included in the permission groups of the SMB file system.
    • The firewall of the Linux ECS instance denies access to the IP address or port 445 of the SMB file system.
    • The Linux ECS instance attempts to connect to the SMB file system by using a Transmission Control Protocol (TCP) port that is not supported. SMB file systems support only port 445.
    Note

    You can run the ping <VolumeDomainName> and telnet <VolumeDomainName>445 commands to check the network connectivity.

    If port 445 is disabled, you must add rules for port 445 to a security group of the ECS instance. For more information, see Add security group rules.

  • The account that you use to log on to the Linux ECS instance does not have the root permissions or is not authorized to run the mount command. You can run the sudo command to authorize the account to run the mount command.
  • The file system type is not set to Common Internet File System (CIFS).
  • The value of the vers parameter in the mount command is not 2.0.
  • The identity of the guest user is not specified when the NAS file system is mounted.
  • The value specified for uid, gid, dir_mode, or file_mode is invalid.
  • The Security-Enhanced Linux (SELinux) settings for the mount directory are invalid.
  • The file system is mounted on more than 1,000 ECS instances that run Linux. In most cases, this issue occurs when you mount a file system on containers.
Solution
  1. Resolve the issue based on the preceding causes. For more information, see Mount an SMB file system on a Linux ECS instance.
  2. Resolve the issue based on the content of the /var/log/messages file and the output of the dmesg command.
  3. Commit Submit a ticket to contact Alibaba Cloud for technical support.

    When you submit a ticket, you must provide the version of your Linux distribution, mount commands, /var/log/messages file, and output of the dmesg command.

How do I improve the performance of an SMB file system that is mounted on Linux?

If the performance of your SMB file system does not meet your requirements, you can improve the performance based on one of the following causes:

  • Cause 1: The throughput of an SMB file system varies based on the storage capacity of the SMB file system. The maximum read/write throughput of the SMB file system has a linear relationship with the capacity of the file system.

    Solution: Use the fio tool to test the performance of the SMB file system. For more information, see Performance testing for Apsara File Storage NAS.

  • Cause 2: The bandwidth of the Linux ECS instance is low.

    Solution: Use multiple Linux ECS instances to make sure that the file system can provide expected performance.

  • Cause 3: Caching is disabled for the SMB client.

    Solution: If the cache parameter is set to strict, caching is enabled. If the cache parameter is set to none, caching is disabled. By default, caching is enabled for an SMB client. You can run the sudo mount | grep cifs command to check the value of the cache parameter.

  • Cause 4: The I/O size of the SMB client does not meet your business requirements.

    Solution: Configure the rsize and wsize parameters based on your business requirements. The default value of the two parameters is 1048576.

  • Cause 5: The Linux ECS instance uses low-specification CPU or memory, or most CPU or memory resources are occupied by other processes.

    Solution: Specify CPU and memory specifications for the Linux ECS instance based on your business requirements. This ensures that the file system can function as expected. You can run the top command to check the CPU utilization and memory usage.

  • Cause 6: The atime parameter is configured when you mount the file system.

    Solution: Do not configure the atime parameter if your business does not require fast file access.

  • Cause 7: The web server such as Apache HTTP Server on the Linux ECS instance processes a few write requests. These requests require notifications and frequent read operations on a large number of small files.

    Solution: Configure the caching mechanism of the web server on the Linux ECS instance. You can also contact Alibaba Cloud to enable the acceleration feature for the web server.

When I mount an SMB file system on Linux, why does it take a long time to migrate or replicate files?

Check the performance of the file system. If the performance of the file system meets your requirements, a possible cause is that the files are not concurrently migrated or replicated. You can use the following open source tools to migrate or replicate files.

  • GNU Parallel

    Specify a number of threads based on your system resources. Example: find * -type | parallel --will-cite -j 10 cp {} /mnt/smb/ &

  • Fpart
  • Fpsync
  • multi

How do I fix the Permission denied error that occurs when I access an SMB file system on Linux?

Cause: You specified an invalid value for the uid, gid, file_mode, or dir_mode parameter when you mounted the file system.

Solution: Verify that the values that are specified for the uid, gid, file_mode, and dir_mode parameters are valid. For more information, see Mount an SMB file system on a Linux ECS instance.

How do I rename the files of an SMB file system by changing the letter case?

The file names of an SMB file system are case-insensitive. This also applies to Windows systems. You cannot rename a file in an SMB file system by changing only the letter case.

However, you can change a file name to a different name that contains different letters. Then, you can change the file name to the original name with a different letter case.

Why am I unable to change the owner of a file and the access mode of a file or a directory?

You can specify the owner of a file and the access mode of a file or directory in a file system only when you mount the file system. For more information, see Mount an SMB file system on a Linux ECS instance.

What do I do if a server does not respond within 35 seconds when multiple clients concurrently access a file on the server?

Cause: The kernel driver of the current SMB protocol fails to work as expected. If the SMB protocol version is 2.1 or 3.0, the server does not respond within 35 seconds. In this case, the clients cannot send SMB break acknowledgment packets to the server.

Solution 1: Set the vers parameter to 2.0 if you mount the file system on the Linux ECS instance.

Solution 2: Perform the following operations:
  1. If the CIFS module is being loaded, run the following command to disable the oplock feature:

    # modprobe cifs enable_oplocks=0

  2. If the CIFS module is already loaded, run the following command to disable the oplock feature:

    # echo 0 > /sys/module/cifs/parameters/enable_oplocks

  3. Run the following command to check the status of the oplock feature:

    # cat /sys/module/cifs/parameters/enable_oplocks

    In the output, Y indicates that the feature is enabled. N indicates that the feature is disabled.

    Note
    • To apply the preceding changes, unmount and remount the SMB file system.
    • To permanently apply the preceding changes, create the /etc/modprobe.d/cifs.conf file and add the options cifs enable_oplocks=0 statement to the file.

Why does the mount target of an SMB file system not respond?

Cause: If the kernel version of your Linux distribution is 3.10.0-514 or earlier, the kernel driver of the SMB protocol may fail to respond when multiple clients concurrently access the file system. As a result, the mount target cannot be accessed. The following record is included in the kernel log:
...
[<ffffffffc03c9bc1>] cifs_oplock_break+0x1f1/0x270 [cifs]
[<ffffffff810a881a>] process_one_work+0x17a/0x440
[<ffffffff810a8d74>] rescuer_thread+0x294/0x3c0
...
Solution
  • Set the cache parameter to none to remount the file system. This may affect the performance of the file system.
  • Upgrade the operating system of the Linux ECS instance.

How do I fix the error that occurs when I mount an NFS file system on Windows?

  • Error message: Invalid file handler

    Solution: Perform the required steps and set the mount parameters to valid values to remount the file system. For more information, see Mount an NFS file system on a Windows ECS instance.

  • Error message: Network error 53

    Solution: Perform the required steps and configure the parameters to remount the file system. For more information, see Mounting NFS on a Windows Client.

  • Error message: Network error 1222

    Solution: After you install an NFS client, remount the file system. For more information, see Install an NFS client.

How do I fix the errors that occur when I soft mount an NFS file system on Windows?

  • Issue
    By default, the soft mode is used when you mount an NFS file system on Windows. However, in some scenarios, soft mounts result in data inconsistency or unexpected application exits.
    • Data inconsistency: An application sends an ECS instance a request to write data to a soft-mounted file system. If the application does not receive a response from the instance before the request times out, an error is returned even if data is written to the file system. In this case, the application determines that the request failed. However, the ECS instance determines that the request is successful. As a result, data inconsistency occurs.
    • Unexpected application exits: An application sends an ECS instance a request to access a soft-mounted file system. If the application does not receive a response from the instance before the request times out, an error is returned. In this case, an exception may be thrown based on the programming language that is used to write the application. If the exception is not handled, the application exits.
  • Solution
    To prevent these issues, hard mount the NFS file system on the Windows ECS instance.
    1. Run the mount command to view the mount mode.
      • If the command output includes mount=soft, perform the following steps.
      • If the command output includes mount=hard, you do not need to perform the following steps. hard
    2. Stop the application that is using the NFS file system.
    3. Run the following command to unmount the NFS file system:
      umount H:
      Replace the drive letter H: based on your business requirements.
    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:
      Replace the mount target address xxxxxx.cn-hangzhou.nas.aliyuncs.com and the drive letter h: based on your business requirements.
    5. Run the mount command to check the mount result.
      If the command output includes mount=hard, locking=no, and timeout=10 or a number greater than 10, the mount is successful. Mount results

How do I fix the invalid device error that is returned when I attempt to rename a file on a Windows NFS client?

If you mount an NFS file system on a subdirectory of an ECS instance, the invalid device error message is returned when you rename a file. To fix this error, mount the file system on the root directory of the ECS instance.

If the system fails to terminate processes that connect to an SMB file system, how do I release the handles that are exposed by a client?

You can use the following tool to remove all connections from an SMB file system. This way, all handles are released.
  • Windows client
    Use the tcpview tool to remove all connections from an SMB file system. For more information, see tcpview. 4
  • Linux client

    Use the killcx tool to remove all connections from an SMB file system. For more information, see killcx.

How do I prevent exceptions that may occur when multiple processes or clients concurrently write data to a log file?

  • Issue

    NAS allows multiple clients to write data to different files in the same namespace. However, NFS does not support atomic appends. If multiple processes or clients concurrently write data to the same file, exceptions such as overwrite, crossover, and disordered content may occur. This is because each process independently maintains context information. The file can be a log file. The context information includes file descriptors and write locations.

  • Solution
    • Recommended. Configure different processes or clients to write data to different files in the same file system. When you analyze or process data, you can merge these files. This solution can resolve the issues that are caused by concurrent write operations without the need to use file locks. This solution does not affect system performance.
    • Use the flock and seek functions together. This ensures the atomicity and consistency of write operations. However, this solution requires a long period of time and may significantly affect system performance. The following steps describe this method.
  • Use the flock and seek functions together

    NFS does not support atomic appends. If multiple clients append data to the same file such as a log, data entries may overwrite each other. In Linux, you can use the flock and seek functions together to simulate atomic appends in an NFS file system. This ensures data consistency when multiple processes concurrently append data to the same file.

    To use the flock and seek functions together, perform the following steps:
    1. Invoke the fd=open(filename, O_WRONLY | O_APPEND | O_DIRECT) statement to open a file by using the append method. This statement is used to set the write method to O_DIRECT and obtain the file descriptor. O_DIRECT specifies a write-only method. In this case, no page cache is used.
    2. Call the flock(fd, LOCK_EX|LOCK_NB) function to obtain a file lock. If the function fails to obtain a file lock, an error message is returned. The possible cause of the failure is that the file lock is in use. You can try again or troubleshoot the failure.
    3. After the file lock is obtained, invoke the lseek(fd, 0, SEEK_END) function to set the current file offset of the file descriptor to the end of the file.
    4. Write data to the end of the file. The file lock is used to prevent data entries from overwriting each other.
    5. After data is written to the file, invoke the flock(fd, LOCK_UN) function to release the file lock.
    The following code shows a sample program that is written in C.
    #define _GNU_SOURCE
    #include<stdlib.h>
    #include<stdio.h>
    #include<fcntl.h>
    #include<string.h>
    #include<unistd.h>
    #include<sys/file.h>
    #include<time.h>
    
    const char *OUTPUT_FILE = "/mnt/blog";
    int WRITE_COUNT = 50000;
    
    int do_lock(int fd)
    {
        int ret = -1;
        while (1)
        {
            ret = flock(fd, LOCK_EX | LOCK_NB);
            if (ret == 0)
            {
                break;
            }
            usleep((rand() % 10) * 1000);
        }
        return ret;
    }
    
    int do_unlock(int fd)
    {
        return flock(fd, LOCK_UN);
    }
    
    int main()
    {
            int fd = open(OUTPUT_FILE, O_WRONLY | O_APPEND | O_DIRECT);
            if (fd < 0)
            {
                    printf("Error Open\n");
                    exit(-1);
            }
            for (int i = 0; i < WRITE_COUNT; ++i)
            {
                    char *buf = "one line\n";
    
                    /* Lock file */
                    int ret = do_lock(fd);
                    if (ret != 0)
                    {
                            printf("Lock Error\n");
                            exit(-1);
                    }
    
                    /* Seek to the end */
                    ret = lseek(fd, 0, SEEK_END);
                    if (ret < 0)
                    {
                            printf("Seek Error\n");
                            exit(-1);
                    }
    
                    /* Write to file */
                    int n = write(fd, buf, strlen(buf));
                    if (n <= 0)
                    {
                            printf("Write Error\n");
                            exit(-1);
                    }
    
                    /* Unlock file */
                    ret = do_unlock(fd);
                    if (ret != 0)
                    {
                            printf("UnLock Error\n");
                            exit(-1);
                    }
            }
            return 0;
    }
                
    For more information about how to invoke the flock() function, see filck().
    Note Only Linux kernel versions 2.6.12 and later support the flock() function. If you use Linux of an earlier kernel version, invoke the fcntl() function.

Why do I need to mount a NAS file system by using the noresvport parameter?

If network switchovers or high availability (HA) switchovers of backend services occur in a NAS file system, the network connection of the file system may be interrupted, and you may need to wait for a few minutes to allow the connection to automatically recover. If the connection fails to automatically recover, you must restart the ECS instance. If you configure the noresvport parameter, the connection can automatically recover within a few seconds.

How do I resolve the issues that are related to the noresvport parameter?

Note This issue exists only for Linux users. If you are a Windows user or you mount NAS file systems by using CSI or Flexvolume plug-ins in Container Service for Kubernetes (ACK) clusters, you can skip this question.
  1. Check whether the noresvport parameter is configured when you mount a file system.
    1. Run the following command on a Linux ECS instance to download the check_noresvport.py script:
      wget -N https://code.aliyun.com/nas_team/nas-client-tools/raw/master/linux_client/check_noresvport.py -P /tmp/
    2. Run the following Python command to run the script:
      python2.7 /tmp/check_noresvport.py -e
      If the "There is no issue for 'noresvport' on this ECS" message appears, skip the following steps.
  2. Resolve the issues that are related to the noresvport parameter.
    Note We recommend that you resolve these issues during off-peak hours.
    Use one of the following solutions to resolve the issues based on your scenario.
    • If you mount a NAS file system on an ECS instance, run the following command to run the script again:
      python2.7 /tmp/check_noresvport.py -e -r
    • If you mount a NAS file system on a container, run the following command to run the script again on the node on which the container resides:
      python2.7 /tmp/check_noresvport.py -e -c
  3. Update the settings for an automatic mount.
    • If an automatic mount is configured, add the noresvport parameter to the settings of the automatic mount. For more information, see Automatically mount the NFS file system.
    • If no automatic mount is configured, skip this step.
    After you complete the preceding steps, repeat Step 1 and verify the result. If you have other questions, submit a ticket to contact Alibaba Cloud for technical support.

What happens when a network switchover or an HA switchover occurs on backend services?

NAS provides stable and continuous file storage services. However, network switchovers or HA switchovers of backend services may still occur in specific scenarios. Service upgrades may trigger HA switchovers of backend services, which may interrupt the client network. Before service upgrades, Alibaba Cloud sends notifications about the upgrade schedule to all related users. This ensures that you have sufficient time to configure the noresvport parameter. We recommend that you configure the noresvport parameter at your earliest opportunity even if no upgrade is scheduled at the backend. This way, connection failures can be prevented in other switchover scenarios, such as switchovers that are triggered by changes on Server Load Balancer (SLB) instances and hardware failures at the backend.

Why do I need to remount a file system? Can I use an alternative solution?

Before you can use the noresvport parameter to mount a file system, you must remount the file system. This way, you can close all TCP connections to which the noresvport parameter is not applied. When you use the noresvport parameter to mount the file system, new TCP connections are established. To close all previous TCP connections, you must stop all services that use the NAS file system. Then, you can run the umount command to unmount the file system.

If you do not want to remount the file system, we recommend that you create a mount target based on a new file system. In this case, you must mount the new file system on a different local directory. You can migrate all services to the new local directory. Then, you can disable the old mount directory and mount target.

How are files whose names are prefixed with .nfs generated? How do I delete the files?

If you delete a file that is being used by an application, a temporary file whose name is prefixed with .nfs is generated. When the process that uses the file ends, the temporary file is automatically deleted.

When I access a file in the directory of a NAS file system, the bind conn to session failed on NFSv4 server error message is returned. How do I fix this error?

  • Cause

    The error message is returned because you mounted the file system by using the NFSv4.1 protocol. NAS does not support this protocol.

  • Solution

    Use the NFSv3.0 or NFSv4.0 protocol to remount the file system based on your business requirements. For more information, see Usage notes.