This topic describes how to troubleshoot issues that may occur when you access a Server Message Block (SMB) file system from a Linux Elastic Compute Service (ECS) instance. This topic also describes the causes and solutions of these issues.

Why am I unable to mount an SMB file system?

Cause:
  • You are using an earlier or inapplicable version of Linux distribution. The following Linux distributions are applicable to SMB file systems:
    • 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)
    • Aliyun Linux (4.19.34-11.al7.x86_64)
    • CoreOS (4.19.43-coreos VersionID=2079.4.0)
  • The cifs-utils package is not installed on the client, or the executable file of the mount.cifs command is not in a directory that is 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 virtual private clouds (VPCs) or one of them resides in a VPC and the other resides in the classic network.
      Note You can mount an Apsara File Storage NAS file system on an on-premises Linux server. If you cannot access the file system from the Linux server, a probable cause is that no network connection is established between the Linux server and the file system. To establish a network connection, use Express Connect.
    • The IP address of the Linux ECS instance is excluded from 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 an unsupported Transmission Control Protocol (TCP) port. SMB file systems support only port 445.
    Note

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

    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) when you mount the file system.
  • The value of the vers option in the mount command is not 2.0.
  • The guest option is not set to username=guest, password=guest, or guest.
  • The specified value 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 Linux ECS instances. This access failure may occur when you mount the file system on multiple nodes of Container Service for Kubernetes.
Solution:
  1. Troubleshoot the failure based on the preceding list of causes. For more information, see Mount an SMB file system on a Linux ECS instance.
  2. Troubleshoot the failure based on the /var/log/messages file and the output of the dmesg command.
  3. Submit a ticket to troubleshoot the failure.

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

Why is the performance of an SMB file system unfavorable?

You can troubleshoot the performance issue of the SMB file system based on the following potential causes:

  • Cause 1: The maximum read/write throughput of the SMB file system is in 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 ECS instances to achieve the expected performance of the file system.

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

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

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

    Solution: Specify the rsize and wsize options based on your business requirements. The default value of the two options 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: Select specifications for the Linux ECS instance based on your business requirements. Check the usage of CPU and memory resources to ensure that the file system is running as expected. You can run the top command to check the usage of CPU and memory resources.

  • Cause 6: The atime option is specified when you mount the file system.

    Solution: Do not specify the atime option if your business is insensitive to the file access time.

  • 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.

Why is the speed of file migration and replication slow?

Troubleshoot the performance issue based on the preceding list of causes. If the issue persists, the probable cause is that concurrent migration or replication is disabled. You can use the following open source tools to migrate or replicate files.

  • GNU Parallel
    Note
    • Specify an appropriate number of threads based on your system resources.
    • Example: find * -type | parallel --will-cite -j 10 cp {} /mnt/smb/ &
  • Fpart
  • Fpsync
  • multi

Why is the error message "Permission denied" returned when you access the SMB file system?

Cause: An invalid value is specified for the uid, gid, file_mode, or dir_mode option when you mount the file system.

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

How do I rename a file by changing the letter case?

File names of the SMB file system are not case-sensitive. This also applies to the Windows operating system. Therefore, a file in the SMB file system cannot be renamed by changing only the letter case.

However, you can change a file name to another name with different letters, and then change the file name back to the original name in different letter case.

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

You can specify the owner of a file and 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.

Why does the server not respond within 35 seconds when multiple clients concurrently access a file?

Cause: The Linux SMB kernel driver is defective. If the SMB protocol version is 2.1 or 3.0, the server does not respond within 35 seconds because the clients cannot send SMB Break Acknowledgment packets to the server.

Solution: Set the vers option to 2.0 when you mount the file system on the Linux ECS instance.

Why am I unable to use ACLs?

Apsara File Storage NAS does not support access control lists (ACLs). If you need to use ACLs, submit a ticket.

Why does the SMB file system not respond when multiple clients concurrently access the file system?

Cause: If the kernel version of your Linux distribution is earlier than or equal to 3.10.0-514, the SMB kernel driver may crash when multiple clients concurrently access a file system. In this case, access to the file system fails. The following example shows log entries that record the failure in the kernel log file:
...
[<ffffffffc03c9bc1>] cifs_oplock_break+0x1f1/0x270 [cifs]
[<ffffffff810a881a>] process_one_work+0x17a/0x440
[<ffffffff810a8d74>] rescuer_thread+0x294/0x3c0
...
Solution:
  • Remount the file system and set the cache option to none. However, this may affect the performance of the file system.
  • Upgrade the operating system of the Linux ECS instance.