'New Azure data disk does not appear when running lsblk from virtual machine's cli
I am attempting to create and attach a new data disk to an Azure linux VM per these instructions: https://docs.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.
Solution 1:[1]
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.
Solution 2:[2]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | mactyr |
Solution 2 | RahulKumarShaw-MT |