Linux - Azure delete blockdevice, Delete mount volume and detach disk

Azure delete blockdevice

Before deleting a blockdevice make sure to backup/snapshot of the disk

check if the disk is mounted or added in any logical volume.
 # pvs | grep vg_1-lv-backup
 # fdisk -l | grep -i /dev/mapper/vg_1-lv-backup

 # lvremove /dev/mapper/vg_1-lv-backup
 # vgremove vg_1
 # pvremove /dev/sde

Finding LUN in azure
 # vgs
 # pvs | grep vg_1
 # lsscsi 
   [5:0:0:2]	Disk	msxx	VirtualDisk	1.0	/dev/sde

   lastnumber is LUN_Number, here 2 the LUN-id of disk /ded/sde
Now Go to portal check the disk and detach disk

The topic on Linux - Azure delete blockdevice is posted by - Indhrani

Hope you have enjoyed, Linux - Azure delete blockdeviceThanks for your time

Tech Bluff