Skip to content

Commit 175f13c

Browse files
committed
add smb linux mount
1 parent 1dd7c0f commit 175f13c

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

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

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: khdownie
55
ms.service: azure-file-storage
66
ms.custom: linux-related-content, devx-track-azurecli
77
ms.topic: how-to
8-
ms.date: 09/09/2024
8+
ms.date: 10/23/2024
99
ms.author: kendownie
1010
---
1111

@@ -352,29 +352,6 @@ The final step is to restart the `autofs` service.
352352
sudo systemctl restart autofs
353353
```
354354
355-
## Mount a file share snapshot
356-
357-
If you want to mount a specific snapshot of an SMB Azure file share, you must supply the `snapshot` option as part of the `mount` command, where `snapshot` is the time that the particular snapshot was created in a format such as @GMT-2023.01.05-00.08.20. The `snapshot` option has been supported in the Linux kernel since version 4.19.
358-
359-
After you've created the file share snapshot, follow these instructions to mount it.
360-
361-
1. In the Azure portal, navigate to the storage account that contains the file share that you want to mount a snapshot of.
362-
2. Select **Data storage > File shares** and select the file share.
363-
3. Select **Operations > Snapshots** and take note of the name of the snapshot you want to mount. The snapshot name will be a GMT timestamp, such as in the screenshot below.
364-
365-
:::image type="content" source="media/storage-how-to-use-files-linux/mount-snapshot.png" alt-text="Screenshot showing how to locate a file share snapshot name and timestamp in the Azure portal." border="true" :::
366-
367-
4. Convert the timestamp to the format expected by the `mount` command, which is **@GMT-year.month.day-hour.minutes.seconds**. In this example, you'd convert **2023-01-05T00:08:20.0000000Z** to **@GMT-2023.01.05-00.08.20**.
368-
5. Run the `mount` command using the GMT time to specify the `snapshot` value. Be sure to replace `<storage-account-name>`, `<file-share-name>`, and the GMT timestamp with your values. The .cred file contains the credentials to be used to mount the share (see [Automatically mount file shares](#automatically-mount-file-shares)).
369-
370-
```bash
371-
sudo mount -t cifs //<storage-account-name>.file.core.windows.net/<file-share-name> /media/<file-share-name>/snapshot1 -o credentials=/etc/smbcredentials/snapshottestlinux.cred,[email protected]
372-
```
373-
374-
6. If you're able to browse the snapshot under the path `/media/<file-share-name>/snapshot1`, then the mount succeeded.
375-
376-
If the mount fails, see [Troubleshoot Azure Files connectivity and access issues (SMB)](/troubleshoot/azure/azure-storage/files-troubleshoot-smb-connectivity?toc=/azure/storage/files/toc.json).
377-
378355
## Next steps
379356
380357
See these links for more information about Azure Files:

articles/storage/files/storage-snapshots-files.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ To delete a snapshot of an existing file share, sign in to the Azure portal and
201201

202202
# [Azure PowerShell](#tab/powershell)
203203

204-
To delete a file share snapshot, run the following PowerShell command. Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with your own values. The `SnapshotTime` parameter must follow the correct name format, such as `2021-05-10T08:04:08Z`.
204+
To delete a file share snapshot, run the following PowerShell command. Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with your own values. The `SnapshotTime` parameter must follow the correct name format, such as `2024-05-10T08:04:08Z`.
205205

206206
```azurepowershell
207207
Remove-AzRmStorageShare -ResourceGroupName "<resource-group-name>" -StorageAccountName "<storage-account-name>" -Name "<file-share-name>" -SnapshotTime "<snapshot-time>"
@@ -210,12 +210,12 @@ Remove-AzRmStorageShare -ResourceGroupName "<resource-group-name>" -StorageAccou
210210
To delete a file share and all its snapshots, run the following PowerShell command. Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with your own values.
211211

212212
```azurepowershell
213-
Remove-AzRmStorageShare "<resource-group-name>" -StorageAccountName "<storage-account-name>" -Name "<file-share-name>" -Include Snapshots
213+
Remove-AzRmStorageShare -ResourceGroupName "<resource-group-name>" -StorageAccountName "<storage-account-name>" -Name "<file-share-name>" -Include Snapshots
214214
```
215215

216216
# [Azure CLI](#tab/cli)
217217

218-
To delete a file share snapshot, run the following Azure CLI command. Replace `<storage-account-name>` and `<file-share-name>` with your own values. The `--snapshot` parameter must follow the correct name format, such as `2021-05-10T08:04:08Z`.
218+
To delete a file share snapshot, run the following Azure CLI command. Replace `<storage-account-name>` and `<file-share-name>` with your own values. The `--snapshot` parameter must follow the correct name format, such as `2024-05-10T08:04:08Z`.
219219

220220
```azurecli
221221
az storage share delete --account-name <storage-account-name> --name <file-share-name> --snapshot <snapshot-time>
@@ -253,6 +253,29 @@ Just like with on-premises Volume Shadow Copy (VSS) snapshots, you can view the
253253
> [!NOTE]
254254
> If your file hasn't changed, you won't see a previous version for that file because that file is the same version as the snapshot. This is consistent with how this works on a Windows file server.
255255
256+
### Mount an SMB file share snapshot on Linux
257+
258+
If you want to mount a specific snapshot of an SMB Azure file share on Linux, you must supply the `snapshot` option as part of the `mount` command, where `snapshot` is the time that the particular snapshot was created in a format such as @GMT-2023.01.05-00.08.20. The `snapshot` option has been supported in the Linux kernel since version 4.19.
259+
260+
After you've created the file share snapshot, follow these instructions to mount it.
261+
262+
1. In the Azure portal, navigate to the storage account that contains the file share that you want to mount a snapshot of.
263+
2. Select **Data storage > File shares** and select the file share.
264+
3. Select **Operations > Snapshots** and take note of the name of the snapshot you want to mount. The snapshot name will be a GMT timestamp, such as in the screenshot below.
265+
266+
:::image type="content" source="media/storage-snapshots-files/mount-smb-snapshot-on-linux.png" alt-text="Screenshot showing how to locate a file share snapshot name and timestamp in the Azure portal." border="true" :::
267+
268+
4. Convert the timestamp to the format expected by the `mount` command, which is **@GMT-year.month.day-hour.minutes.seconds**. In this example, you'd convert **2023-01-05T00:08:20.0000000Z** to **@GMT-2023.01.05-00.08.20**.
269+
5. Run the `mount` command using the GMT time to specify the `snapshot` value. Be sure to replace `<storage-account-name>`, `<file-share-name>`, and the GMT timestamp with your values. The .cred file contains the credentials to be used to mount the share (see [Automatically mount file shares](#automatically-mount-file-shares)).
270+
271+
```bash
272+
sudo mount -t cifs //<storage-account-name>.file.core.windows.net/<file-share-name> /media/<file-share-name>/snapshot1 -o credentials=/etc/smbcredentials/snapshottestlinux.cred,[email protected]
273+
```
274+
275+
6. If you're able to browse the snapshot under the path `/media/<file-share-name>/snapshot1`, then the mount succeeded.
276+
277+
If the mount fails, see [Troubleshoot Azure Files connectivity and access issues (SMB)](/troubleshoot/azure/azure-storage/files-troubleshoot-smb-connectivity?toc=/azure/storage/files/toc.json).
278+
256279
## NFS file share snapshots
257280

258281
Customers using NFS Azure file shares can create, list, and delete share snapshots.
@@ -406,7 +429,7 @@ To delete a snapshot of an existing file share, sign in to the Azure portal and
406429

407430
# [Azure PowerShell](#tab/powershell)
408431

409-
To delete a file share snapshot, run the following PowerShell command. Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with your own values. The `SnapshotTime` parameter must follow the correct name format, such as `2021-05-10T08:04:08Z`.
432+
To delete a file share snapshot, run the following PowerShell command. Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with your own values. The `SnapshotTime` parameter must follow the correct name format, such as `2024-05-10T08:04:08Z`.
410433

411434
```azurepowershell
412435
Remove-AzRmStorageShare -ResourceGroupName "<resource-group-name>" -StorageAccountName "<storage-account-name>" -Name "<file-share-name>" -SnapshotTime "<snapshot-time>"
@@ -415,12 +438,12 @@ Remove-AzRmStorageShare -ResourceGroupName "<resource-group-name>" -StorageAccou
415438
To delete a file share and all its snapshots, run the following PowerShell command. Replace `<resource-group-name>`, `<storage-account-name>`, and `<file-share-name>` with your own values.
416439

417440
```azurepowershell
418-
Remove-AzRmStorageShare "<resource-group-name>" -StorageAccountName "<storage-account-name>" -Name "<file-share-name>" -Include Snapshots
441+
Remove-AzRmStorageShare -ResourceGroupName "<resource-group-name>" -StorageAccountName "<storage-account-name>" -Name "<file-share-name>" -Include Snapshots
419442
```
420443

421444
# [Azure CLI](#tab/cli)
422445

423-
To delete a file share snapshot, run the following Azure CLI command. Replace `<storage-account-name>` and `<file-share-name>` with your own values. The `--snapshot` parameter must follow the correct name format, such as `2021-05-10T08:04:08Z`.
446+
To delete a file share snapshot, run the following Azure CLI command. Replace `<storage-account-name>` and `<file-share-name>` with your own values. The `--snapshot` parameter must follow the correct name format, such as `2024-05-10T08:04:08Z`.
424447

425448
```azurecli
426449
az storage share delete --account-name <storage-account-name> --name <file-share-name> --snapshot <snapshot-time>

0 commit comments

Comments
 (0)