Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Extending LVM Storage by Adding a New Disk in CentOS

Tech Apr 22 31

Add a new physical disk to the system. The system should detect it as /dev/sdb.

Create a physical volume (PV) from the new disk:

pvcreate /dev/sdb

Verify the PV was created:

pvs

Display detailed PV information:

pvdisplay

Extand the existing volume group (VG) by adding the new PV:

vgextend vg_template /dev/sdb

Check the VG details to confirm available free space:

vgdisplay

Extand the logical volume (LV) to use all available free space:

lvextend -l +100%FREE /dev/mapper/vg_template-lv_root

Determine the filesystem type before resizing:

df -Th

For ext4 filesystems, resize with:

resize2fs /dev/mapper/vg_template-lv_root

For XFS filesystems, use:

xfs_growfs /dev/mapper/vg_template-lv_root

Verify the extended storage capacity:

df -Th

Troubleshoooting Disk Filter Issues

If pvcreate fails with "Device excluded by a filter":

parted /dev/sda print

Reinitialize the disk label (WARNING: destroys all data):

parted /dev/sda
(parted) mklabel loop
(parted) print

Related Articles

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.