Showing posts from March, 2021

Attach disk volume in Azure on CentOS VM

  # lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd" sd a     2:0:0:0       30G   |- sd a1               1M   `- sd a2               30G / sd b     3:0:1:0       80G   `- sd b1               80G /mnt/resource sd c     5:0:0:0     512G   If you are attaching a new disk, you need to partition the disk: The parted utility can be used to partition and to format a data disk. The following example uses parted on /dev/sdc, which is where the first data disk will typically be on most VMs. Replace sdc with the correct option for your disk. We are also formatting it using the xfs filesystem. # parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100% # mkfs.xfs /dev/sdc # partprobe /dev/sdc The above partprobe command will make sure the kernel is aware of the new partition and filesystem. Failure to use partprobe can cause the blkid or lslbk commands to not return the UUID for the new filesystem immediately. Use mount to then mount the filesystem: # mkdir /datadrive # mount /dev