New Azure data disk does not appear when running lsblk from virtual machine's cli

1.3k Views Asked by At

I am attempting to create and attach a new data disk to an Azure linux VM per these instructions: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal

Azure Portal reported that the disk was created and attached to my VM successfully, and I can see it listed as a data disk under "Disks" for that VM in Azure Portal. However, when I run lsblk from the VM's command line, as instructed under "Find the disk" in the documentation, the new disk does not appear in the listing. Therefore I can't proceed in setting up the disk.

How can I get the disk to show up in lsblk, or at least begin to diagnose why it didn't? The VM is running Ubuntu 20.04, in case that matters.

For what it's worth, immediately before this, I executed the same process to add a different data disk to a different VM and it went very smoothly, so there seems to be some particular problem with this VM.

2

There are 2 best solutions below

0
On BEST ANSWER

I've been in touch with Azure support and they've diagnosed (through some back-end method) that the storage module (hv_storvsc) on the virtual machine is down. They have stated that the only solution is to reboot the virtual machine.

0
On

If the VM was running when you added the disk, you need to rescan for the new disk. Rebooting will work, but you can rescan without rebooting.

If the sg3-utils package is installed, you can use rescan-scsi-bus.sh to rescan. If not you can use the following:

for h in $(ls /sys/class/scsi_host); do
    echo '- - -' > /sys/class/scsi_host/$h/scan
done

For more information Refer this Document : Virtual Hard Disk is added, but not showing using lsblk -d command