您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

在 Linux 中排查 Azure 文件问题Troubleshoot Azure Files problems in Linux

本文列出了从 Linux 客户端进行连接时,与 Azure 文件相关的常见问题。This article lists common problems that are related to Azure Files when you connect from Linux clients. 此外,还提供了这些问题的可能原因和解决方法。It also provides possible causes and resolutions for these problems.

除本文中的疑难解答步骤之外,还可使用 AzFileDiagnostics 确保 Linux 客户端满足正确的先决条件。In addition to the troubleshooting steps in this article, you can use AzFileDiagnostics to ensure that the Linux client has correct prerequisites. AzFileDiagnostics 自动检测本文中提到的大多数症状。AzFileDiagnostics automates the detection of most of the symptoms mentioned in this article. 它有助于设置环境以获得最佳性能。It helps set up your environment to get optimal performance. 也可以在 Azure 文件共享疑难解答中找到此信息。You can also find this information in the Azure Files shares troubleshooter. 疑难解答提供了帮助你解决连接、映射和装载 Azure 文件共享问题的步骤。The troubleshooter provides steps to help you with problems connecting, mapping, and mounting Azure Files shares.

无法连接或装载 Azure 文件共享Cannot connect to or mount an Azure file share

原因Cause

造成此问题的常见原因包括:Common causes for this problem are:

  • 正在使用不兼容的 Linux 分发客户端。You're using an incompatible Linux distribution client. 建议使用以下 Linux 分发来连接 Azure 文件共享:We recommend that you use the following Linux distributions to connect to an Azure file share:
SMB 2.1SMB 2.1
(装载在同一 Azure 区域内的 VM 上)(Mounts on VMs within the same Azure region)
SMB 3.0SMB 3.0
(从本地和跨区域装载)(Mounts from on-premises and cross-region)
Ubuntu ServerUbuntu Server 14.04+14.04+ 16.04+16.04+
RHELRHEL 7+7+ 7.5+7.5+
CentOSCentOS 7+7+ 7.5+7.5+
DebianDebian 8+8+
openSUSEopenSUSE 13.2+13.2+ 42.3+42.3+
SUSE Linux Enterprise ServerSUSE Linux Enterprise Server 1212 12 SP3+12 SP3+
  • 客户端上未安装 CIFS 实用程序(utils)。CIFS utilities (cifs-utils) are not installed on the client.
  • 客户端上未安装最低的 SMB/CIFS 版本 2.1。The minimum SMB/CIFS version, 2.1, is not installed on the client.
  • 客户端不支持 SMB 3.0 加密。SMB 3.0 encryption is not supported on the client. 上表列出的 Linux 发行版支持使用加密从本地装载以及跨区域装载。The preceding table provides a list of Linux distributions that support mounting from on-premises and cross-region using encryption. 其他分发要求内核 4.11 及更高版本。Other distributions require kernel 4.11 and later versions.
  • 试图通过不受支持的 TCP 端口 445 连接到存储帐户。You're trying to connect to a storage account over TCP port 445, which is not supported.
  • 试图从 Azure VM 连接到 Azure 文件共享,而该 VM 并非与存储帐户处于同一区域。You're trying to connect to an Azure file share from an Azure VM, and the VM is not in the same region as the storage account.
  • 如果在存储帐户上启用了需要安全转移设置,则 Azure 文件仅允许使用带加密的 SMB 3.0 进行连接。If the Secure transfer required setting is enabled on the storage account, Azure Files will allow only connections that use SMB 3.0 with encryption.

解决方案Solution

若要解决此问题,请使用 Troubleshooting tool for Azure Files mounting errors on Linux(用于 Linux 上 Azure 文件装载错误的故障排除工具)。To resolve the problem, use the troubleshooting tool for Azure Files mounting errors on Linux. 此工具:This tool:

  • 有助于验证客户端运行环境。Helps you to validate the client running environment.
  • 可检测导致 Azure 文件访问失败的不兼容客户端配置。Detects the incompatible client configuration that would cause access failure for Azure Files.
  • 可提供自我修复的说明性指导。Gives prescriptive guidance on self-fixing.
  • 可收集诊断跟踪。Collects the diagnostics traces.

装载 Azure 文件共享时出现 "装载错误(13):权限被拒绝""Mount error(13): Permission denied" when you mount an Azure file share

原因 1:信道未加密Cause 1: Unencrypted communication channel

出于安全考虑,如果信道未加密,且连接尝试并非来自 Azure 文件共享所在的同一数据中心,将阻止连接到 Azure 文件共享。For security reasons, connections to Azure file shares are blocked if the communication channel isn't encrypted and if the connection attempt isn't made from the same datacenter where the Azure file shares reside. 如果在存储帐户中启用需要安全传输设置,则还可以阻止同一数据中心中未加密的连接。Unencrypted connections within the same datacenter can also be blocked if the Secure transfer required setting is enabled on the storage account. 仅当用户的客户端 OS 支持 SMB 加密时,才提供加密的信道。An encrypted communication channel is provided only if the user's client OS supports SMB encryption.

若要了解详细信息,请参阅使用 Linux 和 cifs-utils 包装载 Azure 文件共享的先决条件To learn more, see Prerequisites for mounting an Azure file share with Linux and the cifs-utils package.

原因 1 的解决方案Solution for cause 1

  1. 从支持 SMB 加密的客户端进行连接,或者从用于 Azure 文件共享的 Azure 存储帐户所在数据中心内的虚拟机进行连接。Connect from a client that supports SMB encryption or connect from a virtual machine in the same datacenter as the Azure storage account that is used for the Azure file share.
  2. 如果客户端不支持 SMB 加密,请验证是否已在存储帐户上禁用需要安全传输设置。Verify the Secure transfer required setting is disabled on the storage account if the client does not support SMB encryption.

原因2:在存储帐户上启用虚拟网络或防火墙规则Cause 2: Virtual network or firewall rules are enabled on the storage account

如果在存储帐户上配置了虚拟网络 (VNET) 和防火墙规则,则将拒绝访问网络流量,除非允许客户端 IP 地址或虚拟网络访问。If virtual network (VNET) and firewall rules are configured on the storage account, network traffic will be denied access unless the client IP address or virtual network is allowed access.

原因 2 的解决方案Solution for cause 2

验证是否已在存储帐户上正确配置虚拟网络和防火墙规则。Verify virtual network and firewall rules are configured properly on the storage account. 若要测试虚拟网络或防火墙规则是否导致此问题,请将存储帐户上的设置临时更改为“允许来自所有网络的访问”。To test if virtual network or firewall rules is causing the issue, temporarily change the setting on the storage account to Allow access from all networks. 若要了解详细信息,请参阅配置 Azure 存储防火墙和虚拟网络To learn more, see Configure Azure Storage firewalls and virtual networks.

尝试打开文件时出现“[权限被拒绝] 超出磁盘配额”"[permission denied] Disk quota exceeded" when you try to open a file

在 Linux 中,将出现类似于下面的错误消息:In Linux, you receive an error message that resembles the following:

<文件名> [权限被拒绝] 超出磁盘配额<filename> [permission denied] Disk quota exceeded

原因Cause

已达到文件允许的并发打开句柄数上限。You have reached the upper limit of concurrent open handles that are allowed for a file.

单个文件有 2000 个打开句柄配额。There is a quota of 2,000 open handles on a single file. 当你拥有 2000 个打开句柄时,会显示一条错误消息,指示已达到此配额。When you have 2,000 open handles, an error message is displayed that says the quota is reached.

解决方案Solution

关闭一些句柄,减少并发打开句柄的数量,然后重试操作。Reduce the number of concurrent open handles by closing some handles, and then retry the operation.

若要查看文件共享、目录或文件的打开句柄,请使用 Get-AzStorageFileHandle PowerShell cmdlet。To view open handles for a file share, directory or file, use the Get-AzStorageFileHandle PowerShell cmdlet.

若要关闭文件共享、目录或文件的打开句柄,请使用 Close-AzStorageFileHandle PowerShell cmdlet。To close open handles for a file share, directory or file, use the Close-AzStorageFileHandle PowerShell cmdlet.

备注

Get-AzStorageFileHandle 和 Close-AzStorageFileHandle cmdlet 包括在 Az PowerShell 模块 2.4 或更高版本中。The Get-AzStorageFileHandle and Close-AzStorageFileHandle cmdlets are included in Az PowerShell module version 2.4 or later. 若要安装最新 Az PowerShell 模块,请参阅安装 Azure PowerShell 模块To install the latest Az PowerShell module, see Install the Azure PowerShell module.

在 Linux 中将文件复制到 Azure 文件以及从中复制文件时速度缓慢Slow file copying to and from Azure Files in Linux

  • 如果没有特定的最低 I/O 大小要求,建议 I/O 大小为 1 MiB 以实现最佳性能。If you don't have a specific minimum I/O size requirement, we recommend that you use 1 MiB as the I/O size for optimal performance.
  • 使用正确的复制方法:Use the right copy method:
    • 使用 AZCopy 在两个文件共享之间传输任何内容。Use AzCopy for any transfer between two file shares.
    • 将 cp 或 dd 与 parallel 配合使用可以提高复制速度,线程数取决于用例和工作负荷。Using cp or dd with parallel could improve copy speed, the number of threads depends on your use case and workload. 以下示例使用 6 个线程:The following examples use six:
    • cp 示例(cp 将使用文件系统的默认块大小作为区块大小):find * -type f | parallel --will-cite -j 6 cp {} /mntpremium/ &cp example (cp will use the default block size of the file system as the chunk size): find * -type f | parallel --will-cite -j 6 cp {} /mntpremium/ &.
    • dd 示例(此命令将区块大小显式设置为 1 MiB):find * -type f | parallel --will-cite-j 6 dd if={} of=/mnt/share/{} bs=1Mdd example (this command explicitly sets chunk size to 1 MiB): find * -type f | parallel --will-cite-j 6 dd if={} of=/mnt/share/{} bs=1M
    • 开源第三方工具,例如:Open source third party tools such as:
      • GNU ParallelGNU Parallel.
      • Fpart - 将文件排序并将其打包到分区中。Fpart - Sorts files and packs them into partitions.
      • Fpsync - 使用 Fpart 和复制工具生成多个实例,以便将数据从 src_dir 迁移到 dst_url。Fpsync - Uses Fpart and a copy tool to spawn multiple instances to migrate data from src_dir to dst_url.
      • Multi - 基于 GNU coreutils 的多线程 cp 和 md5sum。Multi - Multi-threaded cp and md5sum based on GNU coreutils.
  • 提前设置文件大小而不是让每个写入成为扩展写入,这样可以在文件大小已知的情况下提高复制速度。Setting the file size in advance, instead of making every write an extending write, helps improve copy speed in scenarios where the file size is known. 如果需要避免扩展写入,则可使用 truncate - size <size><file> 命令设置目标文件大小。If extending writes need to be avoided, you can set a destination file size with truncate - size <size><file> command. 然后,dd if=<source> of=<target> bs=1M conv=notrunc命令会复制源文件,不需反复更新目标文件的大小。After that, dd if=<source> of=<target> bs=1M conv=notrunccommand will copy a source file without having to repeatedly update the size of the target file. 例如,可以为每个要复制的文件设置目标文件大小(假定在 /mnt/share 下装载了一个共享):For example, you can set the destination file size for every file you want to copy (assume a share is mounted under /mnt/share):
    • $ for i in `` find * -type f``; do truncate --size ``stat -c%s $i`` /mnt/share/$i; done
    • 然后复制文件,不需以并行方式扩展写入:$find * -type f | parallel -j6 dd if={} of =/mnt/share/{} bs=1M conv=notruncand then - copy files without extending writes in parallel: $find * -type f | parallel -j6 dd if={} of =/mnt/share/{} bs=1M conv=notrunc

使用 SMB 3.0 装载 Azure 文件时出现“装载错误(115): 操作正在进行”"Mount error(115): Operation now in progress" when you mount Azure Files by using SMB 3.0

原因Cause

某些 Linux 分发尚不支持 SMB 3.0 中的加密功能。Some Linux distributions don't yet support encryption features in SMB 3.0. 如果用户尝试使用 SMB 3.0 装载 Azure 文件,可能会由于缺少功能而收到“115”错误消息。Users might receive a "115" error message if they try to mount Azure Files by using SMB 3.0 because of a missing feature. 只有在使用 Ubuntu 16.04 或更高版本时,才支持具有完全加密的 SMB 3.0。SMB 3.0 with full encryption is supported only when you're using Ubuntu 16.04 or later.

解决方案Solution

4.11 内核中引入了适用于 Linux 的 SMB 3.0 加密功能。The encryption feature for SMB 3.0 for Linux was introduced in the 4.11 kernel. 使用此功能可从本地或不同 Azure 区域装载 Azure 文件共享。This feature enables mounting of an Azure file share from on-premises or from a different Azure region. 某些 Linux 分发版可能会将4.11 内核中的向后移植更改为它们维护的旧版本 Linux 内核。Some Linux distributions may have backported changes from the 4.11 kernel to older versions of the Linux kernel which they maintain. 若要帮助确定你的 Linux 版本是否支持使用加密的 SMB 3.0,请参阅将 Azure 文件与 Linux 配合使用To assist in determining if your version of Linux supports SMB 3.0 with encryption, consult with Use Azure Files with Linux.

如果 Linux SMB 客户端不支持加密,请使用 SMB 2.1 从文件共享所在的同一数据中心上的 Azure Linux VM 装载 Azure 文件。If your Linux SMB client doesn't support encryption, mount Azure Files by using SMB 2.1 from an Azure Linux VM that's in the same datacenter as the file share. 验证是否已在存储帐户中禁用需要安全传输设置。Verify that the Secure transfer required setting is disabled on the storage account.

浏览到门户中的 Azure 文件共享时出现“授权失败”错误Error “Authorization failure” when browsing to an Azure file share in the portal

浏览到门户中的 Azure 文件共享时,可能会收到以下错误:When you browse to an Azure file share in the portal, you may receive the following error:

授权失败Authorization failure
你无权访问You do not have access

原因1:你的用户帐户无权访问存储帐户Cause 1: Your user account does not have access to the storage account

原因 1 的解决方案Solution for cause 1

浏览到Azure文件共享所在的存储帐户,单击“访问控制(IAM)”,确保你的用户帐户有权访问该存储帐户。Browse to the storage account where the Azure file share is located, click Access control (IAM) and verify your user account has access to the storage account. 若要了解详细信息,请参阅如何使用基于角色的访问控制 (RBAC) 来保护存储帐户To learn more, see How to secure your storage account with Role-Based Access Control (RBAC).

原因2:在存储帐户上启用虚拟网络或防火墙规则Cause 2: Virtual network or firewall rules are enabled on the storage account

原因 2 的解决方案Solution for cause 2

验证是否已在存储帐户上正确配置虚拟网络和防火墙规则。Verify virtual network and firewall rules are configured properly on the storage account. 若要测试虚拟网络或防火墙规则是否导致此问题,请将存储帐户上的设置临时更改为“允许来自所有网络的访问”。To test if virtual network or firewall rules is causing the issue, temporarily change the setting on the storage account to Allow access from all networks. 若要了解详细信息,请参阅配置 Azure 存储防火墙和虚拟网络To learn more, see Configure Azure Storage firewalls and virtual networks.

无法删除 Azure 文件共享中的文件或目录Unable to delete a file or directory in an Azure file share

原因Cause

如果该文件或目录有一个打开的句柄,通常会出现此问题。This issue typically occurs if the file or directory has an open handle.

解决方案Solution

如果 SMB 客户端关闭了所有打开的句柄,但问题仍然出现,请执行以下操作:If the SMB clients have closed all open handles and the issue continues to occur, perform the following:

备注

Get-AzStorageFileHandle 和 Close-AzStorageFileHandle cmdlet 包括在 Az PowerShell 模块 2.4 或更高版本中。The Get-AzStorageFileHandle and Close-AzStorageFileHandle cmdlets are included in Az PowerShell module version 2.4 or later. 若要安装最新 Az PowerShell 模块,请参阅安装 Azure PowerShell 模块To install the latest Az PowerShell module, see Install the Azure PowerShell module.

Linux VM 上装载的 Azure 文件共享性能缓慢Slow performance on an Azure file share mounted on a Linux VM

原因1:缓存Cause 1: Caching

性能缓慢的一个可能原因是禁用了缓存。One possible cause of slow performance is disabled caching. 缓存在反复访问某个文件时可能很有用,但其他情况下,它是一项开销。Caching can be useful if you are accessing a file repeatedly, otherwise, it can be an overhead. 检查是否在使用缓存,然后再禁用它。Check if you are using the cache before disabling it.

原因 1 的解决方案Solution for cause 1

若要检查是否禁用了缓存,请查找 cache= 条目。To check whether caching is disabled, look for the cache= entry.

cache=none 表示已禁用缓存。Cache=none indicates that caching is disabled. 使用默认的装载命令重新装载共享,或者显式添加 cache=strict 选项到装载命令中,确保默认缓存或“strict”缓存模式已启用。Remount the share by using the default mount command or by explicitly adding the cache=strict option to the mount command to ensure that default caching or "strict" caching mode is enabled.

在某些情况下,serverino 装载选项可能会导致 ls 命令针对每个目录条目运行 stat。In some scenarios, the serverino mount option can cause the ls command to run stat against every directory entry. 当列出大型目录时,此行为会导致性能降级。This behavior results in performance degradation when you're listing a large directory. 可在 /etc/fstab 条目中检查装载选项:You can check the mount options in your /etc/fstab entry:

//azureuser.file.core.windows.net/cifs /cifs cifs vers=2.1,serverino,username=xxx,password=xxx,dir_mode=0777,file_mode=0777

还可以通过运行 sudo mount | grep cifs 命令并检查其输出,检查所用的选项是否正确。You can also check whether the correct options are being used by running the sudo mount | grep cifs command and checking its output. 下面是示例输出:The following is example output:

//azureuser.file.core.windows.net/cifs on /cifs type cifs (rw,relatime,vers=2.1,sec=ntlmssp,cache=strict,username=xxx,domain=X,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.10.1,file_mode=0777, dir_mode=0777,persistenthandles,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,actimeo=1)

如果不存在 cache=strict 或 serverino 选项,请通过运行文档中的装载命令卸载并再次装载 Azure 文件If the cache=strict or serverino option is not present, unmount and mount Azure Files again by running the mount command from the documentation. 然后重新检查 /etc/fstab 条目是否具有正确选项。Then, recheck that the /etc/fstab entry has the correct options.

原因2:限制Cause 2: Throttling

在你遇到限制的情况下,系统可能会将你的请求发送到队列。It is possible you are experiencing throttling and your requests are being sent to a queue. 可以利用 Azure Monitor 中的 Azure 存储指标对此进行验证。You can verify this by leveraging Azure Storage metrics in Azure Monitor.

原因 2 的解决方案Solution for cause 2

确保应用在 Azure 文件存储缩放目标中。Ensure your app is within the Azure Files scale targets.

将文件从 Windows 复制到 Linux 时丢失时间戳Time stamps were lost in copying files from Windows to Linux

在 Linux/Unix 平台上,如果文件 1 和文件 2 由不同的用户拥有,则 cp-p 命令将失败。On Linux/Unix platforms, the cp -p command fails if different users own file 1 and file 2.

原因Cause

COPYFILE 中的强制标志 f 导致在 Unix 上执行 cp -p -fThe force flag f in COPYFILE results in executing cp -p -f on Unix. 此外,此命令无法保存你不拥有的文件的时间戳。This command also fails to preserve the time stamp of the file that you don't own.

解决方法Workaround

使用存储帐户用户来复制文件:Use the storage account user for copying the files:

  • Useadd : [storage account name]
  • Passwd [storage account name]
  • Su [storage account name]
  • Cp -p filename.txt /share

ls: 无法访问 '<path>': 输入/输出错误ls: cannot access '<path>': Input/output error

尝试使用 ls 命令列出 Azure 文件共享中的文件时,该命令在列出文件时挂起。When you try to list files in an Azure file share by using the ls command, the command hangs when listing files. 收到以下错误:You get the following error:

ls: 无法访问 '<path>': 输入/输出错误ls: cannot access'<path>': Input/output error

解决方案Solution

将 Linux 内核升级到以下可解决此问题的版本:Upgrade the Linux kernel to the following versions that have a fix for this problem:

  • 4.4.87+4.4.87+
  • 4.9.48+4.9.48+
  • 4.12.11+4.12.11+
  • 4.13 或更高的所有版本All versions that are greater than or equal to 4.13

原因Cause

默认情况下,使用 CIFS 在 Linux 上装载 Azure 文件共享不会启用符号链接的支持。By default, mounting Azure file shares on Linux by using CIFS doesn’t enable support for symbolic links (symlinks). 出现如下错误:You see an error like this:

ln -s linked -n t
ln: failed to create symbolic link 't': Operation not supported

解决方案Solution

Linux CIFS 客户端不支持通过 SSMB 2 或 3 协议创建 Windows 样式符号链接。The Linux CIFS client doesn’t support creation of Windows-style symbolic links over the SMB 2 or 3 protocol. Linux 客户端目前支持使用称作 Minshall+French 符号链接的另一种样式的符号链接来执行创建和跟踪操作。Currently, the Linux client supports another style of symbolic links called Minshall+French symlinks for both create and follow operations. 需要符号链接的客户可以使用“mfsymlinks”装载选项。Customers who need symbolic links can use the "mfsymlinks" mount option. 我们推建议使用“mfsymlinks”,因为这也是 Macs 使用的格式。We recommend "mfsymlinks" because it's also the format that Macs use.

若要使用符号链接,请将以下代码添加到 CIFS 装载命令的末尾:To use symlinks, add the following to the end of your CIFS mount command:

,mfsymlinks

因此,命令如下所示:So the command looks something like:

sudo mount -t cifs //<storage-account-name>.file.core.windows.net/<share-name> <mount-point> -o vers=<smb-version>,username=<storage-account-name>,password=<storage-account-key>,dir_mode=0777,file_mode=0777,serverino,mfsymlinks

然后,可以按照 wiki 上的建议创建符号链接。You can then create symlinks as suggested on the wiki.

从浏览器访问使用 Azure 文件存储的 Web 应用程序时出现错误 ConditionHeadersNotSupportedError ConditionHeadersNotSupported from a Web Application using Azure Files from Browser

通过使用条件标头的应用程序(如 web 浏览器)访问 Azure 文件中托管的内容时,会发生 ConditionHeadersNotSupported 错误。The ConditionHeadersNotSupported error occurs when accessing content hosted in Azure Files through an application that makes use of conditional headers, such as a web browser, access fails. 错误指出不支持条件标头。The error states that condition headers are not supported.

Azure 文件条件标头错误

原因Cause

尚不支持条件标头。Conditional headers are not yet supported. 实现它们的应用程序将需要在每次访问文件时请求完整的文件。Applications implementing them will need to request the full file every time the file is accessed.

解决方法Workaround

上传新文件时,cache-control 属性默认为“no-cache”。When a new file is uploaded, the cache-control property by default is “no-cache”. 若要强制应用程序每次请求文件,需要将文件的 cache-control 属性从“no-cache”更新为“no-cache, no-store, must-revalidate”。To force the application to request the file every time, the file's cache-control property needs to be updated from “no-cache” to “no-cache, no-store, must-revalidate”. 这可以使用 Azure 存储资源管理器来实现。This can be achieved using Azure Storage Explorer.

Azure 文件条件标头的存储资源管理器内容缓存修改

由于重新连接超时,出现“装载错误(112): 主机已关闭”"Mount error(112): Host is down" because of a reconnection time-out

如果客户端长时间处于空闲状态,Linux 客户端上会发生“112”装载错误。A "112" mount error occurs on the Linux client when the client has been idle for a long time. 长时间空闲后,客户端将断开连接,并发生连接超时。After an extended idle time, the client disconnects and the connection times out.

原因Cause

连接可能出于以下原因而进入空闲状态:The connection can be idle for the following reasons:

  • 发生通信故障,导致使用默认“soft”装载选项时阻止 TCP 与服务器重新建立连接。Network communication failures that prevent re-establishing a TCP connection to the server when the default "soft" mount option is used
  • 最近的重新连接修复程序未在旧内核中提供Recent reconnection fixes that are not present in older kernels

解决方案Solution

此 Linux 内核中重新连接的问题现已在实施以下更改的过程中得到修复This reconnection problem in the Linux kernel is now fixed as part of the following changes:

但是,这些更改可能尚未移植到所有的 Linux 发行版。However, these changes might not be ported yet to all the Linux distributions. 如果你使用的是常用的 Linux 分发版,则可以查看将Azure 文件与 Linux 配合使用,了解你的分发版有必要的内核更改。If you're using a popular Linux distribution, you can check on the Use Azure Files with Linux to see which version of your distribution has the necessary kernel changes.

解决方法Workaround

可以通过指定硬装载来解决此问题。You can work around this problem by specifying a hard mount. 在连接建立或连接明确中断前,硬装载强制客户端等待。A hard mount forces the client to wait until a connection is established or until it's explicitly interrupted. 可以借此防止由于网络超时而导致的错误。You can use it to prevent errors because of network time-outs. 但是,此解决方法可能会导致无限期等待。However, this workaround might cause indefinite waits. 请准备好在必要情况下停止连接。Be prepared to stop connections as necessary.

如果无法升级到最新的内核版本,可通过将每隔 30 秒或更少的时间间隔便会对其进行写入操作的文件保留在 Azure 文件共享中来解决此问题。If you can't upgrade to the latest kernel versions, you can work around this problem by keeping a file in the Azure file share that you write to every 30 seconds or less. 这必须是一个写入操作,例如在文件上重写创建或修改的日期。This must be a write operation, such as rewriting the created or modified date on the file. 否则,可能会得到缓存的结果,并且操作可能不会触发重新连接。Otherwise, you might get cached results, and your operation might not trigger the reconnection.

需要帮助?Need help? 请联系支持人员。Contact support.

如果仍需帮助,请联系支持人员,以快速解决问题。If you still need help, contact support to get your problem resolved quickly.