I have one attached 1TB disk on Azure VM that storage ll be full in some time.
I want to attach second 1TB SSD disk on Azure VM and want to mount on the same directory without losing any data.
can anyone give me steps for this?
-
Your VM is Linux or Windows VM?– Shui shengbaoSep 4, 2017 at 9:39
-
vm is linux based– Tailor DevendraSep 7, 2017 at 9:51
-
You use managed disk or unmanaged disk? According to your scenario, I suggest you had better resize your data disk to 2TB.– Shui shengbaoSep 7, 2017 at 9:53
-
You could not mount two disk on a directory except you use lvm, but you need re-create file system, it will lose your data.– Shui shengbaoSep 7, 2017 at 9:55
-
If you use managed disk, it is easy for you to resize your data disk size.– Shui shengbaoSep 7, 2017 at 9:57
2 Answers
You can expand the OS or data disk to 4TB now. That's the best way assuming 4TB will be enough for your use case, otherwise, I suggest creating a virtual disk with Storage Spaces using multiple data disks and copying the content over.
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/expand-os-disk
After that, you also have to expand the disk in the operating system.
https://technet.microsoft.com/en-us/library/cc771473(v=ws.11).aspx#BKMK_WINUI
If the partition style for your disk is set to MBR, then 2TB will be the maximum size supported, no matter what you have in Azure. To be able to use 4TB disks in a single partition, you need to use GPT.
It depends on your Azure VM OS type, if your VM is Windows series, you could use Bruno Faria's steps. If you use Linux VM, you could not mount multiple disks on the same directory, your data will lose. Please refer to this similar question.
You could add a new disk to Azure VM and mount disk to subdirectory. It is same with you mount first disk to your VM and does not lose any data.
Another solution is as Bruno Farid said, you could resize your original disk to a larger size. Please refer to this link:How to expand virtual hard disks on a Linux VM with the Azure CLI.
az disk update \
--resource-group myResourceGroup \
--name myDataDisk \
--size-gb 2048
Note: It works for managed disk.
Update:
If you VM use unmanaged disk, you also could resize your data disk to 2TB.
1.Stop your VM.
2.Resize data disk to 2048GB. You could find it on Azure Portal.Your VM
-->Disks
3.Start your VM.
4.SSH to your VM and expand disk. Please refer to the link. Start at step 5.
-
@Tailor Devendra You also could resize unmanaged disk size. I test in my lab, it does not lose data. Sep 8, 2017 at 7:45
-
I tried this link earlier but this command
az disk list \ --resource-group myResourceGroup \ --query '[*].{Name:name,Gb:diskSizeGb,Tier:accountType}' \ --output table
is not showing me unmanaged disk list Sep 8, 2017 at 9:53 -
@TailorDevendra Sorry for the later reply. You use unmanaged disk, the output should be null. Sep 11, 2017 at 3:02
-
-
issue not solved yet. Above solution is worked for managed but not for unmanaged. Sep 12, 2017 at 12:38