Attach disk volume in Azure on CentOS VM
# lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
sda 2:0:0:0 30G
|-sda1 1M
`-sda2 30G /
sdb 3:0:1:0 80G
`-sdb1 80G /mnt/resource
sdc 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/sdc /datadrive
To ensure that the drive is remounted automatically after a reboot, it must be added to the /etc/fstab file. To find the UUID of the new drive, use the blkid utility:
# blkid
UUID="59afaa6c-7525-41b4-ab10-53559362e7fd" TYPE="xfs" PARTLABEL="xfspart" PARTUUID="366e8b78-dfbe-4e5e-97a4-48ea6202cf84"
Add the below line in fstab file:
# vi /etc/fstab
UUID=59afaa6c-7525-41b4-ab10-53559362e7fd /datadrive xfs defaults,nofail 1 2
Verify the disk:
# lsblk
#df -h
nutioquo-re Jordan Lee https://wakelet.com/wake/G2USbRE9MKLvvhPWEQ9R9
ReplyDeleteacsotderi
Good Information.
ReplyDeleteLinux Online Training
WusimKti-na_1985 Jessica Wright Kaspersky AntiVirus
ReplyDeleteCamtasia Studio
Autodesk Maya
workpulinthumb
Thank You and that i have a keen supply: When To Renovate House average home remodel cost
ReplyDelete