After creation of block volume , we have to attach the block volume to the compute instance.
Navigation -> Compute -> Instances -> Resource(Attached block volume) -> Attach Block Volume.
After attaching the block volume , we have to go the server(Putty) , we have to update our new volume in the server.
Run lsblk cpmmand to check the existing volumes in the server.
Go to three dots -> iSCSI commands & information
-> Copy the connect command.
Run these commands in the server.
After this we can check , one new volume will be created
“pvdisplay /dev/sdb1”
-> Create a Volume Group
“vgcreate vg_u01 /dev/sdb1”
Run “vgdisplay vg_u01” to display the volume group created and to see the Number of Physical Extent.
-> Create a logical volume and map it to our volume group
“lvcreate -l 12799 -n lv_u01 vg_u01”
“ls -l /dev/mapper/vg_u01-lv_u01”
Logical volume is created inside our volume group .
-> Format this logical volume using a file system
“mkfs.ext4 /dev/mapper/vg_u01-lv_u01”
-> Create a Directory and mount the logical volume
“mkdir /u01”
“mount –t ext4 /dev/mapper/vg_u01-lv_u01 /u01”
Now we can see the logical volume is mounted.
-> Mount this volume permanently in /etc/fstab or else after server reboot this volume will be removed.
“/dev/mapper/vg_u01-lv_u01 /u01 ext4 defaults,_netdev,nofail 0 2”
We have to add this line in /etc/fstab and run mount –a command.