Hello @Abhishek Verma ,
Thanks for reaching out to Microsoft QnA. Happy to answer your query.
OS disk is separate from Data disks, and we cannot shrink the size of a data disk and add that space to OS disk. What you can do is resize the OS disk from the Portal under Size+Performance under the OS disk tab.
Once the OS disk has been resized, you can SSH into your VM and do a lsblk, you will see the new size of the disk. Now, you can either increase the size of any of the existing partition of the OS disk, or create a new partition.
To create a new partition, or resize an existing partition of the OS disk, please follow the steps mentioned here : Expand the OS disk of a Linux VM .
I have done a repro in my lab, I am attaching the commands there. i expanded the size of the OS disk from 64gb to 128 gb, and created a new partition sda3 of 64 gb. We have to then format the partition and mount it on a mountpoint.
Here are the steps : demo.
After following these steps format the partition with the required file system. For eg:
sudo mkfs -t ext4 /dev/sda3
lsblk -f
sudo mkdir mntpnt
(Creating a mountpoint to mount sda3)
sudo mount /dev/sda3 mntpnt
(Mounting sda3 to mountpoint mntpnt)
Hope this helps.
----------------------
Please accept as answer
and upvote
if the information provided was helpful.