Skip to content

Commit e0a3c90

Browse files
authored
Merge pull request #78313 from roygara/newConvention
New convention
2 parents 8319b15 + 4683065 commit e0a3c90

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

articles/storage/files/storage-how-to-use-files-linux.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,54 +78,55 @@ ms.subservice: files
7878

7979
1. **[Install the cifs-utils package for your Linux distribution](#install-cifs-utils)**.
8080

81-
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under the `/mnt` folder. For example:
81+
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under a new folder. For example, the following command creates a new directory, replace **<storage_account_name>** and **<file_share_name>** with the appropriate information for your environment:
8282
8383
```bash
84-
mkdir /mnt/MyAzureFileShare
84+
mkdir -p <storage_account_name>/<file_share_name>
8585
```
8686
87-
1. **Use the mount command to mount the Azure file share**: Remember to replace `<storage-account-name>`, `<share-name>`, `<smb-version>`, `<storage-account-key>`, and `<mount-point>` with the appropriate information for your environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use `3.0` for `<smb-version>`. For Linux distributions that do not support SMB 3.0 with encryption, use `2.1` for `<smb-version>`. An Azure file share can only be mounted outside of an Azure region (including on-premises or in a different Azure region) with SMB 3.0.
87+
1. **Use the mount command to mount the Azure file share**: Remember to replace **<storage_account_name>**, **<share_name>**, **<smb_version>**, **<storage_account_key>**, and **<mount_point>** with the appropriate information for your environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use **3.0** for **<smb_version>**. For Linux distributions that do not support SMB 3.0 with encryption, use **2.1** for **<smb_version>**. An Azure file share can only be mounted outside of an Azure region (including on-premises or in a different Azure region) with SMB 3.0.
8888
8989
```bash
90-
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
90+
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
9191
```
9292
9393
> [!Note]
94-
> When you are done using the Azure file share, you may use `sudo umount <mount-point>` to unmount the share.
94+
> When you are done using the Azure file share, you may use `sudo umount <mount_point>` to unmount the share.
9595
9696
## Create a persistent mount point for the Azure file share with `/etc/fstab`
9797
9898
1. **[Install the cifs-utils package for your Linux distribution](#install-cifs-utils)**.
9999
100-
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under the `/mnt` folder. Wherever you create this, note the absolute path of the folder. For example, the following command creates a new folder under `/mnt` (the path is an absolute path).
100+
1. **Create a folder for the mount point**: A folder for a mount point can be created anywhere on the file system, but it's common convention to create this under a new folder. Wherever you create this, note the absolute path of the folder. For example, the following command creates a new directory, replace **<storage_account_name>** and **<file_share_name>** with the appropriate information for your environment.
101101

102102
```bash
103-
sudo mkdir /mnt/MyAzureFileShare
103+
sudo mkdir -p <storage_account_name>/<file_share_name>
104104
```
105105

106-
1. **Create a credential file to store the username (the storage account name) and password (the storage account key) for the file share.** Remember to replace `<storage-account-name>` and `<storage-account-key>` with the appropriate information for your environment.
106+
1. **Create a credential file to store the username (the storage account name) and password (the storage account key) for the file share.** Replace **<storage_account_name>** and **<storage_account_key>** with the appropriate information for your environment.
107107

108108
```bash
109109
if [ ! -d "/etc/smbcredentials" ]; then
110-
sudo mkdir /etc/smbcredentials
110+
sudo mkdir /etc/smbcredentials
111111
fi
112-
113-
if [ ! -f "/etc/smbcredentials/<storage-account-name>.cred" ]; then
114-
sudo bash -c 'echo "username=<storage-account-name>" >> /etc/smbcredentials/<storage-account-name>.cred'
115-
sudo bash -c 'echo "password=<storage-account-key>" >> /etc/smbcredentials/<storage-account-name>.cred'
112+
if [ ! -f "/etc/smbcredentials/<STORAGE ACCOUNT NAME>.cred" ]; then
113+
sudo bash -c 'echo "username=<STORAGE ACCOUNT NAME>" >> /etc/smbcredentials/<STORAGE ACCOUNT NAME>.cred'
114+
sudo bash -c 'echo "password=7wRbLU5ea4mgc<DRIVE LETTER>PIpUCNcuG9gk2W4S2tv7p0cTm62wXTK<DRIVE LETTER>CgJlBJPKYc4VMnwhyQd<DRIVE LETTER>UT<DRIVE LETTER>yR5/RtEHyT/EHtg2Q==" >> /etc/smbcredentials/<STORAGE ACCOUNT NAME>.cred'
116115
fi
117116
```
118117

119118
1. **Change permissions on the credential file so only root can read or modify the password file.** Since the storage account key is essentially a super-administrator password for the storage account, setting the permissions on the file such that only root can access is important so that lower privilege users cannot retrieve the storage account key.
120119

121120
```bash
122-
sudo chmod 600 /etc/smbcredentials/<storage-account-name>.cred
121+
sudo chmod 600 /etc/smbcredentials/<storage_account_name>.cred
123122
```
124123

125-
1. **Use the following command to append the following line to `/etc/fstab`**: Remember to replace `<storage-account-name>`, `<share-name>`, `<smb-version>`, and `<mount-point>` with the appropriate information for your environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use `3.0` for `<smb-version>`. For Linux distributions that do not support SMB 3.0 with encryption, use `2.1` for `<smb-version>`. An Azure file share can only be mounted outside of an Azure region (including on-premises or in a different Azure region) with SMB 3.0.
124+
1. **Use the following command to append the following line to `/etc/fstab`**: Remember to replace **<storage_account_name>**, **<share_name>**, **<smb_version>**, and **<mount_point>** with the appropriate information for your environment. If your Linux distribution supports SMB 3.0 with encryption (see [Understand SMB client requirements](#smb-client-reqs) for more information), use **3.0** for **<smb_version>**. For Linux distributions that do not support SMB 3.0 with encryption, use **2.1** for **<smb_version>**. An Azure file share can only be mounted outside of an Azure region (including on-premises or in a different Azure region) with SMB 3.0.
126125

127126
```bash
128-
sudo bash -c 'echo "//<storage-account-name>.file.core.windows.net/<share-name> <mount-point> cifs nofail,vers=<smb-version>,credentials=/etc/smbcredentials/<storage-account-name>.cred,dir_mode=0777,file_mode=0777,serverino" >> /etc/fstab'
127+
sudo bash -c 'echo "//<STORAGE ACCOUNT NAME>.file.core.windows.net/<FILE SHARE NAME> /mount/<STORAGE ACCOUNT NAME>/<FILE SHARE NAME> cifs nofail,vers=3.0,credentials=/etc/smbcredentials/<STORAGE ACCOUNT NAME>.cred,dir_mode=0777,file_mode=0777,serverino" >> /etc/fstab'
128+
129+
sudo mount /mount/<STORAGE ACCOUNT NAME>/<FILE SHARE NAME>
129130
```
130131

131132
> [!Note]

0 commit comments

Comments
 (0)