This topic describes common issues, causes, and solutions when you access an SMB file system from a Linux ECS instance.
Failed to mount an SMB file system
- You are using an earlier or incompatible version of Linux. Linux distributions that
are supported by SMB file systems are listed as follows:
- 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 tool is not installed on the client, or the mount.cifs command is not run in a directory that is specified by the PATH environment variable.
- No connection is established between the network that hosts the Linux ECS instance
and the network that hosts 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 designated by Alibaba Cloud.
- The Linux ECS instance and the SMB file system reside in different networks (VPCs
or the classic networks) that cannot communicate with each other.
Note You can mount an Apsara File Storage NAS file system on a local host running Linux. If you cannot access the file system from the local host, you may not have used Express Connect to connect your local IDC with the network where the SMB file system resides.
- The IP address of the Linux ECS instance is excluded from the whitelist 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 connects to the SMB file system by using an unsupported TCP port. SMB file systems only support port 445.
You can use the
telnet <VolumeDomainName> 445commands to check network connections.
If port 445 is disabled on the target ECS instance, we recommend that you add rules for port 445 to a security group of the ECS instance. For more information, see Add security group rules.
- The administrator of the Linux ECS instance does not have the root permissions or is not authorized to use the mount command. You can use the sudo command to authorize the administrator to use the mount command.
- The type of file system is not set to Common Internet File System (CIFS) when you mount the file system.
- The version of the CIFS protocol is not 2.0.
- The Guest mount option is not specified.
- The specified value for uid, gid, dir_mode, or file_mode is invalid.
- The SELinux settings for the mount directory are invalid.
- The file system is mounted on more than 1,000 Linux ECS instances. This may be the cause when you cannot mount a file system on a node of Container Service for Kubernetes.
- See Access an SMB file system from a Linux ECS instance and check the preceding causes.
- Check the /var/log/messages file and the output of the dmesg command.
- Contact Alibaba Cloud Technical Support.
You need to provide the version of your Linux operating system, mount commands, /var/log/messages log file, and output of the dmesg command.
Unfavorable performance of an SMB file system
The following lists the potential causes for the unfavorable performance of the SMB file system.
- Cause 1: Not much storage space is in use. The maximum read/write throughput of a
single SMB file system is in linear relationship with used storage space.
Solution: Use the fio tool to test the performance of the SMB file system. For more information, see Performance testing for NAS.
- Cause 2: The bandwidth of the Linux ECS instance is low.
Solution: Use multiple ECS instances to achieve the expected performance.
- Cause 3: The cache for the SMB client is disabled.
Solution: Enable the cache by using the cache parameter. If the parameter is set to strict, the cache is enabled. If the cache parameter is set to none, the cache is disabled. By default, the cache for the SMB client is enabled. You can run the
sudo mount | grep cifscommand to check the value of the cache parameter.
- Cause 4: The I/O size set for the SMB client does not meet your business requirements.
Solution: Specify a rsize or wsize value based on your business requirements. The default value is 1048576 .
- Cause 5: The Linux ECS instance uses low-specification CPU or memory. Otherwise, most
CPU or memory resources are occupied by other processes.
Solution: Select specifications for the Linux ECS instance based on your business and check the usage of CPU and memory resources to ensure that the file system is running as expected. You can run the
topcommand 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 access time.
- Cause 7: The web server that is installed on the Linux ECS instance encounters a few
write operations that require notifications and a large number of read operations.
Solution: Configure a cache specific to the web server such as Apache HTTP Server on the file system client. Otherwise, contact Alibaba Cloud Technical Support to enable the acceleration feature for the web server.
Slow file migration or replication from an SMB file system
If the preceding performance issues are excluded, the cause of this issue may be that concurrent migration or replication is not enabled. You can use the following open-source tools to migrate or replicate files.
An error message "Permission denied" returned while you access the SMB file system
Cause: The administrator of the Linux ECS instance specifies an invalid value for the uid, gid, file_mode, or dir_mode parameter when mounting the file system.
Solution: Check whether the value specified for each mount option is valid, such as uid, gid, file_mode, and dir_mode. For more information, see Access an SMB file system from a Linux ECS instance.
Failed to rename a file by changing uppercase letters to lowercase letters or lowercase letters to uppercase letters
File names of the SMB file system are case insensitive, same as a Windows operating system. Therefore, files cannot be renamed by changing only the text 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 but with different capitalization rules.
Failed 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 Access an SMB file system from a Linux ECS instance.
No response from the SMB client within 35 seconds in case of concurrent access to a file
Cause: The Linux SMB kernel driver is defective. When 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: Use SMB 2.0 to mount the file system on the Linux ECS instance.
Unable to use ACLs
Apsara File Storage NAS does not support access control lists (ACLs). If you need to use ACLs, contact Alibaba Cloud Technical Support.
No response from an SMB mount target
... [<ffffffffc03c9bc1>] cifs_oplock_break+0x1f1/0x270 [cifs] [<ffffffff810a881a>] process_one_work+0x17a/0x440 [<ffffffff810a8d74>] rescuer_thread+0x294/0x3c0 ...
- Remount the file system with the cache parameter set to none. However, this may affect the performance of the file system.
- Upgrade the operating system of the Linux ECS instance.