Lvm Resizing in Centos

Source: Internet
Author: User

The/data DIRECTORY needs to be resized due to production, from the original 90 GB to 190 GB, increasing the space by GB.
The production environment is a RHEL server, and the backend is connected to the EMC storage through an optical fiber switch. First, RAID the idle hard disk on the EMC storage, divide the LUN, and map it to the production RHEL server.
(Note: the premise of this expansion is that the partition must be completed in LVM format)
I. Original server disk Information
# Df-H
/Dev/datavg/lv_data
90G, 81G, 9G, 90%/data
# Lvdisplay
--- Logical volume ---
LV Name/dev/datavg/lv_data
VG Name datavg
Lvuuid Sgpcu1-7Xhr-0gwH-qjJ6-QwBB-k2KA-9DJvFt
LV Write Access read/write
LV Status available
# Open 1
LV Size 90.00 GB
Current LE 24882
Segments 10
Allocation inherit
Read ahead sectors auto
-Currently sets to 256
Blocks device 253: 1

2. Restart the server, identify the newly added LUN on EMC, and expand the datavg volume on the server side.
# Powerrmt display dev = all
Pseudo name = emcpowery
CLARiiON ID = CKM00110900942 [SG_DRAGON]
Logical device ID = 6006016003602C00F0154D04917BE011 [LUN 211]
State = alive; policy = CLAROpt; priority = 0; queued-IOs = 0;
Owner: default = sp a, current = sp a Array failover mode: 1
========================================================== ==============================================
--------------- Host ----------------Stor--- I/O Path -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
========================================================== ==============================================
7 qla2xxx sdan SP B0 active alive 0 0
5 qla2xxx sdas SP B1 active alive 0 0
7 qla2xxx sdbo SP A1 active alive 0 0
5 qla2xxx sdq SP A0 active alive 0 0
# Powerrmt config
# Powerrmt save

Step 3:
Fdisk/dev/emcpowery1 and then add a new partition according to n;
Enter p to create the primary partition, and press ENTER twice to distribute all the space to the partition;
Input t to convert the partition type; input 8e to convert to linux lvm partition;
Enter w to write, save, and exit.
Create PV
[Root @ linuxas/] # pvcreate/dev/emcpowery1
Join an existing logical volume group
[Root @ linuxas/] # vgextend datavg/dev/emcpowery1
Resizing LVM
[Root @ linuxas/] # lvextend-L + 100G/dev/datavg/lv_data
Check the relationship between inode and block of the LVM Device
[Root @ linuxas/] # e2fsck-f/dev/datavg/lv_data
Make the added capacity take effect
[Root @ linuxas/] # resize2fs/dev/datavg/lv_data
Iv. Verification
# Df-H
/Dev/datavg/lv_data
190G 81G 109G 43%/data
# Lvdisplay
--- Logical volume ---
LV Name/dev/datavg/lv_data
VG Name datavg
Lvuuid Sgpcu1-7Xhr-0gwH-qjJ6-QwBB-k2KA-9DJvFt
LV Write Access read/write
LV Status available
# Open 1
LV Size 190.00 GB
Current LE 39882
Segments 10
Allocation inherit
Read ahead sectors auto
-Currently sets to 256
Blocks device 253: 1


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.