LVM 系统扩容步骤

  1. insert the disks in the slots.
  2. check the device
    # ls /dev/sd*
  3. create partitions, assuming /dev/sdd is the new disk.
    # fdisk /dev/sdd
  4. create a physical volume.
    # pvcreate /dev/sdd1
  5. extend the centos volume group.
    # vgextend centos /dev/sdd1
  6. extend the centos/home logical volume upto 100% of the free space.
    # lvextend -l +100%FREE /dev/centos/home
  7. grow the centos/home logical volume file system.
    # xfs_growfs /dev/centos/home
  8. grow the centos/home logical volume file system.
    # vgdisplay # check the volume group info
    --- Volume group ---
    VG Name centos
    System ID
    Format lvm2
    Metadata Areas 3
    Metadata Sequence No 8
    VG Access read/write
    VG Status resizable
    MAX LV 0
    Cur LV 4
    Open LV 4
    Max PV 0
    Cur PV 3
    Act PV 3
    VG Size <5.46 TiB
    PE Size 4.00 MiB
    Total PE 1430487
    Alloc PE / Size 1430487 / <5.46 TiB
    Free PE / Size 0 / 0
    VG UUID xasdf-wqpe-askdjw-erpx-z5Ov

display the physical volume info
# pvdisplay
--- Physical volume ---
PV Name /dev/sdb3
VG Name centos
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476625
Free PE 1
Allocated PE 476624
PV UUID Jcx0x8-zt4I-K69K-t5z1-UE00-i5g3-jHob1x

display the logical volume info
# pvdisplay
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID 6SApg8-ADnV-02bb-MakZ-pVmj-VA7g-5A8nP3
LV Write Access read/write
LV Creation host, time localhost, 2018-08-07 06:32:52 +0800
LV Status available

open 1

LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID Xv9arG-bAzV-CYx0-Ft2y-7P2K-RzG0-QSd20K
LV Write Access read/write
LV Creation host, time localhost, 2018-08-07 06:32:59 +0800
LV Status available

open 2

LV Size 15.50 GiB
Current LE 3968
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.