Skip to content

Commit 7c6f7f7

Browse files
authored
Merge pull request #8809 from MicrosoftDocs/main
Auto push to live 2025-04-26 02:29:27
2 parents dd63cc7 + 29326c5 commit 7c6f7f7

1 file changed

Lines changed: 41 additions & 27 deletions

File tree

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,66 @@
11
---
22
title: Recommended and useful mountOptions settings on Azure Files
33
description: Learn about the useful and recommended mountOptions settings when you configure the storage class object on Azure Files.
4-
ms.date: 09/14/2024
4+
ms.date: 04/25/2025
55
ms.reviewer: chiragpa, nickoman, v-leedennis
66
ms.service: azure-kubernetes-service
77
#Customer intent: As an Azure Kubernetes user, I want to learn about mount option settings so that I can set up my Azure Files storage class object optimally on my Azure Kubernetes Service (AKS) cluster.
88
ms.custom: sap:Storage
99
---
1010
# Use mountOptions settings in Azure Files
1111

12-
This article discusses the useful and recommended mounting options when you configure the storage class object on Azure Files. These mounting options help you to provision storage on your Kubernetes cluster.
12+
This article discusses recommended mount options when you configure the storage class object on Azure Files. These mounting options help you to provision storage on your Kubernetes cluster.
1313

1414
## Recommended settings
1515

16-
The following `mountOptions` field settings are recommended for the Kubernetes version and the file and directory mode (permissions):
16+
The following `mountOptions` are recommended for SMB and NFS shares:
1717

18-
| Setting | Recommended value |
19-
|----------------------------------|-------------------|
20-
| Kubernetes version | 1.12.2 or later |
21-
| `file_mode` and `dir_mode` value | `0777` |
22-
23-
The following configuration file is an example of how to set the file and directory permissions:
18+
**SMB shares**
2419

2520
```yaml
26-
kind: StorageClass
2721
apiVersion: storage.k8s.io/v1
22+
kind: StorageClass
2823
metadata:
29-
name: azurefile
30-
provisioner: kubernetes.io/azure-file
31-
mountOptions:
32-
- dir_mode=0777
33-
- file_mode=0777
34-
- uid=1000
35-
- gid=1000
36-
- mfsymlinks
37-
- nobrl
38-
- cache=none
24+
name: azurefile-csi
25+
provisioner: file.csi.azure.com
26+
allowVolumeExpansion: true
3927
parameters:
40-
skuName: Standard_LRS
28+
skuName: Premium_LRS # available values: Premium_LRS, Premium_ZRS, Standard_LRS, Standard_GRS, Standard_ZRS, Standard_RAGRS, Standard_RAGZRS
29+
reclaimPolicy: Delete
30+
volumeBindingMode: Immediate
31+
mountOptions:
32+
- dir_mode=0777 # modify this permission if you want to enhance the security
33+
- file_mode=0777 # modify this permission if you want to enhance the security
34+
- mfsymlinks # support symbolic links
35+
- cache=strict # https://linux.die.net/man/8/mount.cifs
36+
- nosharesock # reduces probability of reconnect race
37+
- actimeo=30 # reduces latency for metadata-heavy workload
38+
- nobrl # disable sending byte range lock requests to the server and for applications which have challenges with posix locks
4139
```
4240
43-
## Other useful settings
41+
**NFS shares**
42+
43+
```yaml
44+
apiVersion: storage.k8s.io/v1
45+
kind: StorageClass
46+
metadata:
47+
name: azurefile-csi-nfs
48+
provisioner: file.csi.azure.com
49+
parameters:
50+
protocol: nfs
51+
skuName: Premium_LRS # available values: Premium_LRS, Premium_ZRS
52+
reclaimPolicy: Delete
53+
volumeBindingMode: Immediate
54+
allowVolumeExpansion: true
55+
mountOptions:
56+
- nconnect=4 # improves performance by enabling multiple connections to share
57+
- noresvport # improves availability
58+
- actimeo=30 # reduces latency for metadata-heavy workloads
59+
```
4460
45-
You might also find the following `mountOptions` settings useful:
61+
> [!NOTE]
62+
> The location to configure mount options (mountOptions) depends on whether you're provisioning dynamic or static persistent volumes. If you're [dynamically provisioning a volume](/azure/aks/azure-csi-files-storage-provision#dynamically-provision-a-volume) with a storage class, specify the mount options on the storage class object (kind: StorageClass). If you’re [statically provisioning a volume](/azure/aks/azure-csi-files-storage-provision#statically-provision-a-volume), specify the mount options on the PersistentVolume object (kind: PersistentVolume). If you’re [mounting the file share as an inline volume](/azure/aks/azure-csi-files-storage-provision#mount-file-share-as-an-inline-volume), specify the mount options on the Pod object (kind: Pod).
4663
47-
| Setting | Description |
48-
|--|--|
49-
| `mfsymlinks` | This setting forces the Azure Files mount (Common Internet File System, or cifs) to support symbolic links. |
50-
| `nobrl` | This setting prevents sending byte range lock requests to the server. It's necessary for certain applications that break with cifs-style mandatory byte range locks. Most cifs servers don't yet support requesting advisory byte range locks. If an application doesn't use this setting and breaks with cifs-style mandatory byte range locks, error messages such as `Error: SQLITE_BUSY: database is locked` might occur. |
64+
For best practices when using Azure Files, see [Provision Azure Files storage](/azure/aks/azure-csi-files-storage-provision#best-practices).
5165
5266
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)