Data Disk created in Azure portal. But not visible in VM ?

Virocs Technologies 0 Reputation points
2024-08-18T06:28:19.4166667+00:00

Created Data disk from Azure portal and attached it. but not visible in the VM.

Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
630 questions
{count} votes

2 answers

Sort by: Most helpful
  1. TP 90,636 Reputation points
    2024-08-18T07:45:18.0566667+00:00

    Hi,

    Did you connect to the VM and create partition(s), format, etc? This is necessary after creating new disk and attaching it to VM.

    For example, for windows VM you could connect using RDP and use Disk Management, for Linux VM you could connect using SSH and use fdisk. If you are unsure how to proceed add a comment below with details and I'll assist further.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


  2. Nehruji R 7,556 Reputation points Microsoft Vendor
    2024-08-19T12:31:35.4533333+00:00

    Hello Virocs Technologies,

    Greetings! Welcome to Microsoft Q&A Platform.

    I understand that you created a data disk to VM, but the disk isn’t appearing in the Azure portal. Please consider checking the below following factors to resolve the issue,

    Double-check that the disk is properly attached to the VM. You can do this by running,

    $vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
    $vm.StorageProfile.DataDisks
    
    

    This command will list all data disks attached to the VM. Ensure your new disk is listed

    • Sometimes, changes take a bit of time to reflect in the Azure portal. Try refreshing the portal or logging out and back in.
    • Ensure the disk is in the same resource group and region as your VM. You can verify this in the Azure portal under the disk’s properties.
    • After attaching the disk, you might need to mount it within the VM. This can be done using the following PowerShell commands:
    $vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
    $vm.StorageProfile.DataDisks | ForEach-Object {
        if ($_.Lun -eq 0) {
            $_.CreateOption = "Attach"
            $_.ManagedDisk = $disk
        }
    }
    Update-AzVM -ResourceGroupName $rgName -VM $vm
    
    

    If the disk still doesn’t show up, you might need to manually add it through the Azure portal. Go to your VM’s settings, select “Disks,” and then add the data disk from there.

    refer - https://learn.microsoft.com/en-us/azure/virtual-machines/windows/tutorial-manage-data-disk, https://learn.microsoft.com/en-us/azure/virtual-machines/windows/os-disk-swap.

    Hope this information helps! Please let us know if you have any further queries. I’m happy to assist you further.   


    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.Greetings! Welcome to Microsoft Q&A Platform.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.