Looking for a data disk attached to Azure VM 3000 ri ……


# ・ Introduction

I launched a Linux VM in Azure, but I can't find the attached disk. You're in trouble at that time, right?

Even if you google lightly, "just set from the portal" or " dmesg | grep SCSI white ([official document](https://docs.microsoft.com/ja-jp/azure/virtual-machines/linux/attach -disk-portal)) ”, but I can't find what I can't find.
** It should be connected, so hit some command and it should come out! As a result of googled for an hour with words such as ** and "Azure VM data disk connection Linux", the solution seems to have been unexpectedly close, so I would like to write down the details.

・ Df

The first thing that comes to mind when it comes to checking discs is the royal road df command, but it doesn't seem to work for unmounted discs. This article I see something from df -h and run parted, but I have no idea what the decision was based on. ..


## · Dmesg | grep SCSI Wow, a lot of things come out (Konami)

Storage is treated as a SCSI device, so you can find it by grep SCSI, right? The idea is extremely simple and logical, but I didn't have enough knowledge to narrow down which one is the data disk.

・ Fdisk

** Yes, this is the correct answer. ** To be precise, I ran sudo fdisk -l on the console and it was easy to find the attached datadisk.

If you just try to access the storage path, you will get angry like not founded, so create a partition and mount it in a specific directory.

Regarding the detailed method Mount Managed Disk on Linux VM in Azure Memorable when cutting the disk with the parted command Is written in detail.

・ Summary

EfyXwuyVAAAf5rw.jpg


When I finished this case, I felt that it was natural, but when I couldn't find the data disk, I was quite impatient. While thinking that GUI is great, when I experience the power of Linux, which consumes only 1GB of RAM including Nginx, mysql, and node.js, I think it is the "de facto standard". strong…………

The rest of the story goes awry, but I feel that it is a merit and demerit that the command comes out as it is if I google today. I don't think I would step on a major nuclear mine like sudo rm -rf /, but this time I almost halved the size of the storage.

"The Internet can only be used by people who can see a lie as a lie." This is the late Hiroyuki's words, but the literacy of ** I don't take it for granted that I haven't verified it myself ** will become even more important in the future. I feel like coming.

See you again

Recommended Posts

Looking for a data disk attached to Azure VM 3000 ri ……
How to create a SAS token for Azure IoT Hub
Created a method to downsample for unbalanced data (for binary classification)
A story addicted to Azure Pipelines
A note when looking for an alternative to pandas rolling for moving windows
[MNIST] Convert data to PNG for keras
How to use "deque" for Python data
[Introduction to Python] How to get the index of data with a for statement