FortiSIEM
FortiSIEM provides Security Information and Event Management (SIEM) and User and Entity Behavior Analytics (UEBA)
alaxkar
Staff
Staff
Article Id 358354
Description

This article describes Logical Volume Manager, a tool in Linux that provides a more flexible and powerful way to manage disk storage compared to traditional partitioning methods.

With LVM, this can create logical volumes that span across multiple physical disks, allowing for easier resizing and management of disk space. Here are the basic concepts and how LVM works.

Scope FortiSIEM.
Solution

To expand an LVM disk, follow these steps:

 

Step 1. Check the current disk and LVM setup.

 

df -h

 

Disk UsesDisk Uses

 

Step 2. Add a new disk to the server and rescan the SCSI subsystem for new or removed devices without the server reboot.

 

fdisk -l |grep Disk
bash -c 'echo "- - -" > /sys/class/scsi_host/host0/scan'
fdisk -l |grep Disk

 

Scan diskScan disk

 

Step 3. Declare the required variable and create an LVM partition.

 

export DISK=/dev/sdb  <-- Replace this disk with newly added disk.
fdisk -u $DISK
fdisk -l $DISK


Create PartitionCreate Partition

 

Step 4. Create Physical Volume (PV) from the newly added disk. 


export DISK=${DISK}1
echo ${DISK}   --> Verify that newly disk in the output is accurate. 
pvcreate -tvd $DISK
pvcreate -vd $DISK
pvdisplay -C

 PV CreatePV Create

 

Step 5. Extend Volume Group (VG).


df -h
vgdisplay -v |grep centos (Find Volume Group from above command and replace with CENTOS)
export VG=centos
echo ${VG}
vgextend $VG $DISK
pvscan | grep centos


VG ExtendVG Extend

 

Step 6. LV extend.


lvdisplay -v $VG
lvdisplay -v |grep centos

_LV_NAME="/dev/centos/root"  <-- Mention LV PATH from above command.
lvextend ${_LV_NAME} ${DISK}
lvdisplay -v  <-- To verify that the mounted partition is in ext or xfs format.
df -hT /
mount | egrep 'ext|xfs'

For ext format:- resize2fs ${_LV_NAME}  <-- i.e. Run this command to resize if the partition is in EXT4 filesystem.

For XFS format:- xfs_growfs ${_LV_NAME} <--i.e. Run this command to resize if the partition is in XFS filesystem.

df -hT / <-- To verify the final expansion.

 LV extend and ResizeLV extend and Resize