RHEL9.5中VG扩容


[root@io01 ~]# pvcreate /dev/mapper/mpathb /dev/mapper/mpathd /dev/mapper/mpathe /dev/mapper/mpathf
  Physical volume "/dev/mapper/mpathb" successfully created.
  Physical volume "/dev/mapper/mpathd" successfully created.
  Physical volume "/dev/mapper/mpathe" successfully created.
  Physical volume "/dev/mapper/mpathf" successfully created.
  Not creating system devices file due to existing VGs.
[root@io01 ~]# vgs
  VG        #PV #LV #SN Attr   VSize  VFree
  export_vg   1   1   0 wz--n- 18.69t 1.43g
  rhel        1   3   0 wz--n- <1.82t    0
[root@io01 ~]# vgextend export_vg /dev/mapper/mpathb /dev/mapper/mpathd /dev/mapper/mpathe /dev/mapper/mpathf
  Volume group "export_vg" successfully extended
[root@io01 ~]# vgs
  VG        #PV #LV #SN Attr   VSize    VFree
  export_vg   5   1   0 wz--n- <125.41t <106.72t
  rhel        1   3   0 wz--n-   <1.82t       0
[root@io01 ~]# vgs
  VG        #PV #LV #SN Attr   VSize    VFree
  export_vg   4   1   0 wz--n- <125.31t <106.62t
  rhel        1   3   0 wz--n-   <1.82t       0
[root@io01 ~]# vgcreate pbs_vg /dev/mapper/mpathf
  Not creating system devices file due to existing VGs.
  Volume group "pbs_vg" successfully created
[root@io01 ~]# vgs
  VG        #PV #LV #SN Attr   VSize    VFree
  export_vg   4   1   0 wz--n- <125.31t <106.62t
  pbs_vg      1   0   0 wz--n- <100.00g <100.00g
  rhel        1   3   0 wz--n-   <1.82t       0
[root@io01 ~]# lvcreate -l +100%FREE -n pbs_lv pbs_vg
  Logical volume "pbs_lv" created.
[root@io01 ~]# lvs
  LV        VG        Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  export_lv export_vg -wi-a-----   18.69t
  pbs_lv    pbs_vg    -wi-a----- <100.00g
  home00    rhel      -wi-ao----    1.74t
  root00    rhel      -wi-ao----   70.00g
  swap00    rhel      -wi-ao----    4.00g
[root@io01 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/pbs_vg/pbs_lv
  LV Name                pbs_lv
  VG Name                pbs_vg
  LV UUID                pb60NL-7emM-rsa1-dkuV-QV04-jh8j-BGeuCK
  LV Write Access        read/write
  LV Creation host, time io01, 2025-01-25 20:25:49 +0800
  LV Status              available
  # open                 0
  LV Size                <100.00 GiB
  Current LE             25599
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:9

  --- Logical volume ---
  LV Path                /dev/export_vg/export_lv
  LV Name                export_lv
  VG Name                export_vg
  LV UUID                Pq8D1O-dlrr-GBDU-92KW-qGaY-PcuE-XcbI0d
  LV Write Access        read/write
  LV Creation host, time io01, 2019-12-25 16:18:56 +0800
  LV Status              available
  # open                 0
  LV Size                18.69 TiB
  Current LE             4899472
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:8

  --- Logical volume ---
  LV Path                /dev/rhel/swap00
  LV Name                swap00
  VG Name                rhel
  LV UUID                4Bi3g3-pdtE-5Rz8-3KjT-kbUn-QUhY-nBKNhs
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2025-01-25 11:22:50 +0800
  LV Status              available
  # open                 2
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/rhel/home00
  LV Name                home00
  VG Name                rhel
  LV UUID                qcoaKI-kFy0-VAKn-sV4I-miU3-BSmT-SsiRhH
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2025-01-25 11:22:50 +0800
  LV Status              available
  # open                 1
  LV Size                1.74 TiB
  Current LE             457247
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Path                /dev/rhel/root00
  LV Name                root00
  VG Name                rhel
  LV UUID                TtyFM4-Boqk-miKF-ni7r-77qd-7EQf-oFXoHt
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2025-01-25 11:22:54 +0800
  LV Status              available
  # open                 1
  LV Size                70.00 GiB
  Current LE             17920
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

[root@io01 ~]# lvextend -l 100%FREE /dev/export_vg/export_lv
  Size of logical volume export_vg/export_lv changed from 18.69 TiB (4899472 extents) to <106.62 TiB (27949362 extents).
  Logical volume export_vg/export_lv successfully resized.
[root@io01 ~]# mount -a
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
[root@io01 ~]# df -h
文件系统                         容量  已用  可用 已用% 挂载点
devtmpfs                         4.0M     0  4.0M    0% /dev
tmpfs                             63G     0   63G    0% /dev/shm
tmpfs                             25G   13M   25G    1% /run
efivarfs                          88K   73K   11K   87% /sys/firmware/efi/efivars
/dev/mapper/rhel-root00           70G  4.8G   66G    7% /
/dev/sda2                        960M  366M  595M   39% /boot
/dev/mapper/rhel-home00          1.8T   13G  1.8T    1% /home
/dev/sda1                        599M  7.1M  592M    2% /boot/efi
tmpfs                             13G   92K   13G    1% /run/user/983
tmpfs                             13G   36K   13G    1% /run/user/0
/dev/mapper/export_vg-export_lv   19T   19T  216G   99% /export
[root@io01 ~]# xfs_growfs /export/
meta-data=/dev/mapper/export_vg-export_lv isize=512    agcount=19, agsize=268435455 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0, rmapbt=0
         =                       reflink=0    bigtime=0 inobtcount=0 nrext64=0
data     =                       bsize=4096   blocks=5017059328, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 5017059328 to 28620146688
[root@io01 ~]# df -h
文件系统                         容量  已用  可用 已用% 挂载点
devtmpfs                         4.0M     0  4.0M    0% /dev
tmpfs                             63G     0   63G    0% /dev/shm
tmpfs                             25G   13M   25G    1% /run
efivarfs                          88K   73K   11K   87% /sys/firmware/efi/efivars
/dev/mapper/rhel-root00           70G  4.8G   66G    7% /
/dev/sda2                        960M  366M  595M   39% /boot
/dev/mapper/rhel-home00          1.8T   13G  1.8T    1% /home
/dev/sda1                        599M  7.1M  592M    2% /boot/efi
tmpfs                             13G   92K   13G    1% /run/user/983
tmpfs                             13G   36K   13G    1% /run/user/0
/dev/mapper/export_vg-export_lv  107T   19T   89T   18% /export
[root@io01 ~]# ls /dev/mapper/pbs_vg-pbs_lv
/dev/mapper/pbs_vg-pbs_lv
[root@io01 ~]# vi /etc/inittab
[root@io01 ~]# vi /etc/fstab
[root@io01 ~]# mkfs
mkfs         mkfs.cramfs  mkfs.ext2    mkfs.ext3    mkfs.ext4    mkfs.fat     mkfs.minix   mkfs.msdos   mkfs.vfat    mkfs.xfs
[root@io01 ~]# mkfs.xfs /dev/mapper/pbs_vg-pbs_lv
meta-data=/dev/mapper/pbs_vg-pbs_lv isize=512    agcount=4, agsize=6553344 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=0
data     =                       bsize=4096   blocks=26213376, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@io01 ~]# mkfs.xfs /dev/mapper/pbs_vg-pbs_lv ^C
[root@io01 ~]# mount -a
mount: /pbspro: 挂载点不存在.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
[root@io01 ~]# mkdir /pbspro
[root@io01 ~]# mount -a
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
[root@io01 ~]# systemctl daemon-reload
[root@io01 ~]# mount -a
[root@io01 ~]# df -h
文件系统                         容量  已用  可用 已用% 挂载点
devtmpfs                         4.0M     0  4.0M    0% /dev
tmpfs                             63G     0   63G    0% /dev/shm
tmpfs                             25G   13M   25G    1% /run
efivarfs                          88K   73K   11K   87% /sys/firmware/efi/efivars
/dev/mapper/rhel-root00           70G  4.8G   66G    7% /
/dev/sda2                        960M  366M  595M   39% /boot
/dev/mapper/rhel-home00          1.8T   13G  1.8T    1% /home
/dev/sda1                        599M  7.1M  592M    2% /boot/efi
tmpfs                             13G   92K   13G    1% /run/user/983
tmpfs                             13G   36K   13G    1% /run/user/0
/dev/mapper/export_vg-export_lv  107T   19T   89T   18% /export
/dev/mapper/pbs_vg-pbs_lv        100G  746M  100G    1% /pbspro
[root@io01 ~]# vgs
  VG        #PV #LV #SN Attr   VSize    VFree
  export_vg   4   1   0 wz--n- <125.31t 18.69t
  pbs_vg      1   1   0 wz--n- <100.00g     0
  rhel        1   3   0 wz--n-   <1.82t     0
[root@io01 ~]# lvextend -l 100%FREE /dev/export_vg/export_lv
  New size given (4899472 extents) not larger than existing size (27949362 extents)
[root@io01 ~]# xfs_growfs /export/
meta-data=/dev/mapper/export_vg-export_lv isize=512    agcount=107, agsize=268435455 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0, rmapbt=0
         =                       reflink=0    bigtime=0 inobtcount=0 nrext64=0
data     =                       bsize=4096   blocks=28620146688, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@io01 ~]# df -h
文件系统                         容量  已用  可用 已用% 挂载点
devtmpfs                         4.0M     0  4.0M    0% /dev
tmpfs                             63G     0   63G    0% /dev/shm
tmpfs                             25G   13M   25G    1% /run
efivarfs                          88K   73K   11K   87% /sys/firmware/efi/efivars
/dev/mapper/rhel-root00           70G  4.8G   66G    7% /
/dev/sda2                        960M  366M  595M   39% /boot
/dev/mapper/rhel-home00          1.8T   13G  1.8T    1% /home
/dev/sda1                        599M  7.1M  592M    2% /boot/efi
tmpfs                             13G   92K   13G    1% /run/user/983
tmpfs                             13G   36K   13G    1% /run/user/0
/dev/mapper/export_vg-export_lv  107T   19T   89T   18% /export
/dev/mapper/pbs_vg-pbs_lv        100G  746M  100G    1% /pbspro
[root@io01 ~]# vgdisplay export_vg
  --- Volume group ---
  VG Name               export_vg
  System ID
  Format                lvm2
  Metadata Areas        4
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                4
  Act PV                4
  VG Size               <125.31 TiB
  PE Size               4.00 MiB
  Total PE              32848834
  Alloc PE / Size       27949362 / <106.62 TiB
  Free  PE / Size       4899472 / 18.69 TiB
  VG UUID               WEsPMM-pnrO-6bsu-WbQ0-7AlC-3vkf-aYFXdr

[root@io01 ~]# lvextend -l +100%FREE /dev/export_vg/export_lv
  Size of logical volume export_vg/export_lv changed from <106.62 TiB (27949362 extents) to <125.31 TiB (32848834 extents).
  Logical volume export_vg/export_lv successfully resized.
[root@io01 ~]# xfs_growfs /export/
meta-data=/dev/mapper/export_vg-export_lv isize=512    agcount=107, agsize=268435455 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0, rmapbt=0
         =                       reflink=0    bigtime=0 inobtcount=0 nrext64=0
data     =                       bsize=4096   blocks=28620146688, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 28620146688 to 33637206016
[root@io01 ~]# df -h
文件系统                         容量  已用  可用 已用% 挂载点
devtmpfs                         4.0M     0  4.0M    0% /dev
tmpfs                             63G     0   63G    0% /dev/shm
tmpfs                             25G   13M   25G    1% /run
efivarfs                          88K   73K   11K   87% /sys/firmware/efi/efivars
/dev/mapper/rhel-root00           70G  4.8G   66G    7% /
/dev/sda2                        960M  366M  595M   39% /boot
/dev/mapper/rhel-home00          1.8T   13G  1.8T    1% /home
/dev/sda1                        599M  7.1M  592M    2% /boot/efi
tmpfs                             13G   92K   13G    1% /run/user/983
tmpfs                             13G   36K   13G    1% /run/user/0
/dev/mapper/export_vg-export_lv  126T   19T  107T   15% /export
/dev/mapper/pbs_vg-pbs_lv        100G  746M  100G    1% /pbspro
[root@io01 ~]#

文章作者: TerSup
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 TerSup !
  目录