azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

LUN number and HCTL output

Open dazinator opened this issue 3 years ago • 3 comments

It reads:

Here, sdc is the disk that we want, because it is 50G. If you add multiple disks, and aren't sure which disk it is based on size alone, you can go to the VM page in the portal, select Disks, and check the LUN number for the disk under Data disks. Compare the LUN number from the portal to the last number of the HTCL portion of the output, which is the LUN

Yet looking at the output shown above this comment there would appear to be multiple HCTL output all with LUN 0:

sda     0:0:0:0      30G
├─sda1             29.9G /
├─sda14               4M
└─sda15             106M /boot/efi
sdb     1:0:1:0      14G
└─sdb1               14G /mnt
sdc     3:0:0:0      50G

E.g the last number of the HTCL appears to be 0 in all of the cases shown - so what does it mean exactly?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

dazinator avatar Nov 11 '22 11:11 dazinator

I'm trying to develop a script that I could execute as a script extension to a newly deployed VM, that will run unattended to create a partition and format it (from the newly attached disk). The only thing I know in advance is LUN number of the attached disk.

I have multiple instances of VM's that have attached the same (shared) disk, and in most cases the shared disk - which always has LUN 0, ends up being sdc

However in one instance, the shared disk on one of the VM's is reported as sda

image

So I can't assume that the disk is always under sdc for example.

dazinator avatar Nov 11 '22 11:11 dazinator

For example here is a command that will give me the name of the disks (filters out partitions) with a specific size. However suppose the disk being attached happened to be same size as the OS disk, how would I know which is which - given both HTCL's end with 0 (as shown in my previous comment above)

image

dazinator avatar Nov 11 '22 12:11 dazinator

@dazinator Thanks for your feedback! We will investigate and update as appropriate.

SaibabaBalapur-MSFT avatar Nov 11 '22 15:11 SaibabaBalapur-MSFT

@dazinator Firstly, Apologies for the delay response! I'd recommend posting your question in https://azure.microsoft.com/en-us/support/community/ since it's not directly related to the documentation. We'll follow up there. We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

SumanthMarigowda avatar Dec 03 '22 09:12 SumanthMarigowda

@SumanthMarigowda I think this does relate directly to the documentation.. I've quoted the portion of the documentation that is misleading or untrue - but let me put it here again, it states:

Here, sdc is the disk that we want, because it is 50G. If you add multiple disks, and aren't sure which disk it is based on size alone, you can go to the VM page in the portal, select Disks, and check the LUN number for the disk under Data disks. Compare the LUN number from the portal to the last number of the HTCL portion of the output, which is the LUN

Yet look at the screenshot I posted - multiple disks have 0 as the last portion of the HCTL so how can this be true?

dazinator avatar Dec 03 '22 10:12 dazinator