About Me

My photo
I am MCSE in Data Management and Analytics with specialization in MS SQL Server and MCP in Azure. I have over 13+ years of experience in IT industry with expertise in data management, Azure Cloud, Data-Canter Migration, Infrastructure Architecture planning and Virtualization and automation. Contact me if you are looking for any sort of guidance in getting your Infrastructure provisioning automated through Terraform. I sometime write for a place to store my own experiences for future search and read by own blog but can hopefully help others along the way. Thanks.

LVM Commands, Formatting, and Mounting the File System

Add a disk for use with SQL on linux

----------------------------------------------

from  HYPERV or VMWARE add 50 GB additional disk to linux server


$ lsblk


--partitioning

$pvcreate /dev/sdb1  
       
 -- v for volume creation
$vgcreate vg_data /dev/sdb1   

– l for logical disk creation
$lvcreate –n lv_data –extents 100%FREE vg_create     

Format the logical volume with a file system
---------------------------------------------------------
       xfs & ext4 are supported.

Command to format.
--------------------------------------
$ mkfs.xfs /dev/vg_data/lv_data

Mount the volume in your file system
-----------------------------------------------------------------
$ mount –t xfs /dev/vg_data/lv_data  /var/opt/mssql/data1

Persistently mount the volume in your file system
----------------------------------------------------------------

Go to /etc/fstab

$vi /etc/fstab

Insert below line

/dev/vg_data/lv_data /var/opt/mssql/data1 xfs defaults 0 0