Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Extending LVM Storage by Adding a New Disk in CentOS

Tech 2

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

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

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...

Leave a Comment

Anonymous

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