Skip to content

Commit 17d4fd6

Browse files
authored
Merge pull request #8769 from cynthn/detach
update and new topic
2 parents 4c50d26 + 1abd4b4 commit 17d4fd6

File tree

5 files changed

+72
-9
lines changed

5 files changed

+72
-9
lines changed

articles/virtual-machines/linux/TOC.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
### Attach a disk
9595
#### [Azure CLI](../virtual-machines-linux-add-disk.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
9696
#### [Azure portal](../virtual-machines-linux-attach-disk-portal.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
97+
### [Detach a disk](../virtual-machines-linux-detach-disk.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
9798
### [Expand the OS disk](../virtual-machines-linux-expand-disks.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
9899
### [Configure software RAID](../virtual-machines-linux-configure-raid.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
99100
### [Configure LVM](../virtual-machines-linux-configure-lvm.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
Loading
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Detach a data disk from a Linux VM - Azure| Microsoft Docs
3+
description: Learn to detach a data disk from a virtual machine in Azure using CLI 2.0 or the Azure portal.
4+
services: virtual-machines-linux
5+
documentationcenter: ''
6+
author: cynthn
7+
manager: timlt
8+
editor: ''
9+
tags: azure-service-management
10+
11+
ms.assetid:
12+
ms.service: virtual-machines-linux
13+
ms.workload: infrastructure-services
14+
ms.tgt_pltfrm: vm-windows
15+
ms.devlang: na
16+
ms.topic: article
17+
ms.date: 03/21/2017
18+
ms.author: cynthn
19+
20+
---
21+
# How to detach a data disk from a Linux virtual machine
22+
23+
When you no longer need a data disk that's attached to a virtual machine, you can easily detach it. This removes the disk from the virtual machine, but doesn't remove it from storage.
24+
25+
> [!WARNING]
26+
> If you detach a disk it is not automatically deleted. If you have subscribed to Premium storage, you will continue to incur storage charges for the disk. For more information refer to [Pricing and Billing when using Premium Storage](../storage/storage-premium-storage.md#pricing-and-billing).
27+
>
28+
>
29+
30+
If you want to use the existing data on the disk again, you can reattach it to the same virtual machine, or another one.
31+
32+
## Detach a data disk using CLI 2.0
33+
34+
```azurecli
35+
az vm disk detach -g myResourceGroup --vm-name myVm -n myDataDisk
36+
```
37+
38+
The disk remains in storage but is no longer attached to a virtual machine.
39+
40+
41+
## Detach a data disk using the portal
42+
1. In the portal hub, select **Virtual Machines**.
43+
2. Select the virtual machine that has the data disk you want to detach and click **Stop** to deallocate the VM.
44+
3. In the virtual machine blade, select **Disks**.
45+
4. At the top of the **Disks** blade, select **Edit**.
46+
5. In the **Disks** blade, to the far right of the data disk that you would like to detach, click the ![Detach button image](./media/virtual-machines-common-detach-disk/detach.png) detach button.
47+
5. After the disk has been removed, click Save on the top of the blade.
48+
6. In the virtual machine blade, click **Overview** and then click the **Start** button at the top of the blade to restart the VM.
49+
50+
The disk remains in storage but is no longer attached to a virtual machine.
51+
52+
53+
54+
55+
56+
57+
58+
59+
## Next steps
60+
If you want to reuse the data disk, you can just [attach it to another VM](virtual-machines-linux-add-disk.md?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
61+

articles/virtual-machines/virtual-machines-windows-detach-disk.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Detach a data disk from a Windows VM | Microsoft Docs
2+
title: Detach a data disk from a Windows VM - Azure| Microsoft Docs
33
description: Learn to detach a data disk from a virtual machine in Azure using the Resource Manager deployment model.
44
services: virtual-machines-windows
55
documentationcenter: ''
@@ -14,7 +14,7 @@ ms.workload: infrastructure-services
1414
ms.tgt_pltfrm: vm-windows
1515
ms.devlang: na
1616
ms.topic: article
17-
ms.date: 09/27/2016
17+
ms.date: 03/21/2017
1818
ms.author: cynthn
1919

2020
---
@@ -30,12 +30,14 @@ If you want to use the existing data on the disk again, you can reattach it to t
3030

3131
## Detach a data disk using the portal
3232
1. In the portal hub, select **Virtual Machines**.
33-
2. Select the virtual machine that has the data disk you want to detach and then click **All settings**.
34-
3. In the **Settings** blade, select **Disks**.
35-
4. In the **Disks** blade, select the data disk that you would like to detach.
36-
5. In the blade for the data disk, click **Detach**.
33+
2. Select the virtual machine that has the data disk you want to detach and click **Stop** to deallocate the VM.
34+
3. In the virtual machine blade, select **Disks**.
35+
4. At the top of the **Disks** blade, select **Edit**.
36+
5. In the **Disks** blade, to the far right of the data disk that you would like to detach, click the ![Detach button image](./media/virtual-machines-common-detach-disk/detach.png) detach button.
37+
5. After the disk has been removed, click Save on the top of the blade.
38+
6. In the virtual machine blade, click **Overview** and then click the **Start** button at the top of the blade to restart the VM.
39+
3740

38-
![Screenshot showing the Detach button.](./media/virtual-machines-windows-detach-disk/detach-disk.png)
3941

4042
The disk remains in storage but is no longer attached to a virtual machine.
4143

@@ -52,8 +54,7 @@ Remove-AzureRmVMDataDisk -VM $VirtualMachine -Name "DataDisk3"
5254
Update-AzureRmVM -ResourceGroupName "RG11" -Name "MyVM07" -VM $VirtualMachine
5355
```
5456

55-
56-
For more information, see [Remove-AzureRmVMDataDisk](https://msdn.microsoft.com/library/mt603614.aspx)
57+
For more information, see [Remove-AzureRmVMDataDisk](/powershell/remove-azurermvmdatadisk).
5758

5859
## Next steps
5960
If you want to reuse the data disk, you can just [attach it to another VM](virtual-machines-windows-attach-disk-portal.md?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

0 commit comments

Comments
 (0)