Saturday, October 31, 2015

Extend Volume Group (VG) / Logical Volume (LV) / File System on Linux System

Extend Volume Group (VG) / Logical Volume (LV) / File System on Linux System


Step: 1

Add New Hard Disk into the VM / Physical .

Refer below Link for Adding Disk details.
Add New Virtual (or) Physical Hard Disk on Linux System


Step: 2

Display the Added New Disk.

root@#fdisk -l

Disk /dev/sdb 100 GB, 100000000000 bytes
255 heads, 63 sectors/track, 15665 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Step: 3

Extend Volume Group (VG).

root@#vgextend data_vg /dev/sdb
Volume group "data_vg" successfully extended

Step: 4

Extend Logical Volume(LV).

[root]# lvextend -L+25G /dev/data_vg/data_lv

Extending logical volume data_lv to 50.00 GiB
Logical volume data_lv successfully resized

Step: 5

Resize the Logical Volume (LV). It will automatically Increase  file system size.

[root]# resize2fs /dev/data_vg/data_lv

resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/data_vg/data_lv is mounted on data; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 4
Performing an on-line resize of /dev/data_vg/data_lv to 13107200 (4k) blocks.
The filesystem on /dev/data_vg/data_lv is now 13107200 blocks long.

Step: 6

[root]# df -h /data

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/data_vg-data_lv
                      50G  25G   25G  50% data



No comments:

Post a Comment

Gitlab Automation Project Showcase

My GitLab Projects Showcase 🚀 Welcome to my portfolio of GitLab projects. Each repository reflects my journey as an engineer, focusing...