.---------------------------------------------------------------------------------------------扩容前-----------------------------------------------------------------[root@host-10-1-236-107 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/rootvg-lv_root 36G 3.1G 33G 9% /devtmpfs 7.9G 0 7.9G 0% /devtmpfs 7.9G 0 7.9G 0% /dev/shmtmpfs 7.9G 8.4M 7.9G 1% /runtmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup/dev/mapper/locvg01-lvg01fs01 99G 80G 14G 86% /data01/dev/vda1 509M 110M 399M 22% /boottmpfs 1.6G 0 1.6G 0% /run/user/0[root@host-10-1-236-107 ~]#---------------------------------------------------------------------------------------------pvdisplay-----------------------------------------------------------------[root@host-10-1-236-107 ~]# pvdisplay --- Physical volume --- PV Name /dev/vda2 VG Name rootvg PV Size 39.50 GiB / not usable 3.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 10111 Free PE 0 Allocated PE 10111 PV UUID 0x4sm9-hBfb-bFw2-ONb3-QTGx-jygn-0R0yxO --- Physical volume --- 已经做过磁盘 PV Name /dev/vdb VG Name locvg01 PV Size 100.00 GiB / not usable 64.00 MiB Allocatable yes (but full) PE Size 64.00 MiB Total PE 1599 Free PE 0 Allocated PE 1599 PV UUID 2YYSqC-sUwD-MTU0-Ofqe-3G7J-7weo-cqCIxV---------------------------------------------------------------------------------------------lvdisplay-----------------------------------------------------------------[root@host-10-1-236-107 ~]# lvdisplay --- Logical volume --- LV Path /dev/rootvg/lv_swap LV Name lv_swap VG Name rootvg LV UUID 7r3rxI-pSn6-Nc6V-Bpod-8yxr-JQ3p-UKsSyq LV Write Access read/write LV Creation host, time rhel7.2, 2017-01-30 17:12:20 +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 8192 Block device 253:1 --- Logical volume --- LV Path /dev/rootvg/lv_root LV Name lv_root VG Name rootvg LV UUID vjtTFP-uGTd-aiTl-OUTp-JoqA-Fybr-g3LLty LV Write Access read/write LV Creation host, time rhel7.2, 2017-01-30 17:12:20 +0800 LV Status available # open 1 LV Size 35.50 GiB Current LE 9087 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0 --- Logical volume --- LV Path /dev/locvg01/lvg01fs01 LV Name lvg01fs01 VG Name locvg01 LV UUID Od9bkn-uMAx-UdY3-3FYV-vLXn-nxjy-lu6Hnb LV Write Access read/write LV Creation host, time host-10-1-236-107, 2018-03-09 11:35:05 +0800 LV Status available # open 1 LV Size 99.94 GiB Current LE 1599 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2---------------------------------------------------------------------------------------------vgdisplay -----------------------------------------------------------------[root@host-10-1-236-107 ~]# vgdisplay --- Volume group --- VG Name rootvg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 39.50 GiB PE Size 4.00 MiB Total PE 10111 Alloc PE / Size 10111 / 39.50 GiB Free PE / Size 0 / 0 VG UUID suS0aK-Yzls-4pbD-kIWv-6W18-7qgU-DyZP9U --- Volume group --- VG Name locvg01 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 99.94 GiB PE Size 64.00 MiB Total PE 1599 Alloc PE / Size 1599 / 99.94 GiB Free PE / Size 0 / 0 VG UUID ypudQB-S3H9-Dm5k-fTEG-D8vv-1wFC-2niESC---------------------------------------------------------------------------------------------fdisk -l-----------------------------------------------------------------[root@host-10-1-236-107 ~]# fdisk -lDisk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x0002c2fa Device Boot Start End Blocks Id System/dev/vda1 * 2048 1050623 524288 83 Linux/dev/vda2 1050624 83886079 41417728 8e Linux LVMDisk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/vdc: 214.7 GB, 214748364800 bytes, 419430400 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/rootvg-lv_root: 38.1 GB, 38113640448 bytes, 74440704 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/rootvg-lv_swap: 4294 MB, 4294967296 bytes, 8388608 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/locvg01-lvg01fs01: 107.3 GB, 107307073536 bytes, 209584128 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes[root@host-10-1-236-107 ~]#---------------------------------------------------------------------------------------------pvcreate -----------------------------------------------------------------pvcreate /dev/vdc[root@host-10-1-236-107 ~]# pvcreate /dev/vdc Physical volume "/dev/vdc" successfully created---------------------------------------------------------------------------------------------pvdisplay-----------------------------------------------------------------[root@host-10-1-236-107 ~]# pvdisplay --- Physical volume --- PV Name /dev/vda2 VG Name rootvg PV Size 39.50 GiB / not usable 3.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 10111 Free PE 0 Allocated PE 10111 PV UUID 0x4sm9-hBfb-bFw2-ONb3-QTGx-jygn-0R0yxO --- Physical volume --- PV Name /dev/vdb VG Name locvg01 PV Size 100.00 GiB / not usable 64.00 MiB Allocatable yes (but full) PE Size 64.00 MiB Total PE 1599 Free PE 0 Allocated PE 1599 PV UUID 2YYSqC-sUwD-MTU0-Ofqe-3G7J-7weo-cqCIxV "/dev/vdc" is a new physical volume of "200.00 GiB" --- NEW Physical volume --- PV Name /dev/vdc VG Name PV Size 200.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID LhbzqO-Nrb0-yy8a-t47A-54ef-N9on-8ByiTW---------------------------------------------------------------------------------------------vgextend -----------------------------------------------------------------vgextend locvg01 /dev/vdc[root@host-10-1-236-107 ~]# vgextend locvg01 /dev/vdc Volume group "locvg01" successfully extended[root@host-10-1-236-107 ~]# vgdisplay --- Volume group --- VG Name rootvg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 39.50 GiB PE Size 4.00 MiB Total PE 10111 Alloc PE / Size 10111 / 39.50 GiB Free PE / Size 0 / 0 VG UUID suS0aK-Yzls-4pbD-kIWv-6W18-7qgU-DyZP9U --- Volume group --- VG Name locvg01 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 299.88 GiB PE Size 64.00 MiB Total PE 4798 Alloc PE / Size 1599 / 99.94 GiB Free PE / Size 3199 / 199.94 GiB VG UUID ypudQB-S3H9-Dm5k-fTEG-D8vv-1wFC-2niESC---------------------------------------------------------------------------------------------lvextend -----------------------------------------------------------------lvextend -L +199G /dev/locvg01/lvg01fs01[root@host-10-1-236-107 ~]# lvextend -L +199G /dev/locvg01/lvg01fs01 Size of logical volume locvg01/lvg01fs01 changed from 99.94 GiB (1599 extents) to 298.94 GiB (4783 extents). Logical volume lvg01fs01 successfully resized.[root@host-10-1-236-107 ~]# lvdisplay --- Logical volume --- LV Path /dev/rootvg/lv_swap LV Name lv_swap VG Name rootvg LV UUID 7r3rxI-pSn6-Nc6V-Bpod-8yxr-JQ3p-UKsSyq LV Write Access read/write LV Creation host, time rhel7.2, 2017-01-30 17:12:20 +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 8192 Block device 253:1 --- Logical volume --- LV Path /dev/rootvg/lv_root LV Name lv_root VG Name rootvg LV UUID vjtTFP-uGTd-aiTl-OUTp-JoqA-Fybr-g3LLty LV Write Access read/write LV Creation host, time rhel7.2, 2017-01-30 17:12:20 +0800 LV Status available # open 1 LV Size 35.50 GiB Current LE 9087 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0 --- Logical volume --- LV Path /dev/locvg01/lvg01fs01 LV Name lvg01fs01 VG Name locvg01 LV UUID Od9bkn-uMAx-UdY3-3FYV-vLXn-nxjy-lu6Hnb LV Write Access read/write LV Creation host, time host-10-1-236-107, 2018-03-09 11:35:05 +0800 LV Status available # open 1 LV Size 298.94 GiB Current LE 4783 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2---------------------------------------------------------------------------------------------lvextend -----------------------------------------------------------------resize2fs /dev/locvg01/lvg01fs01[root@host-10-1-236-107 ~]# resize2fs /dev/locvg01/lvg01fs01resize2fs 1.42.9 (28-Dec-2013)Filesystem at /dev/locvg01/lvg01fs01 is mounted on /data01; on-line resizing requiredold_desc_blocks = 13, new_desc_blocks = 38The filesystem on /dev/locvg01/lvg01fs01 is now 78364672 blocks long.[root@host-10-1-236-107 ~]#---------------------------------------------------------------------------------------------df -h-----完成热扩容查看-----------------------------------------------------------------[root@host-10-1-236-107 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/rootvg-lv_root 36G 3.1G 33G 9% /devtmpfs 7.9G 0 7.9G 0% /devtmpfs 7.9G 0 7.9G 0% /dev/shmtmpfs 7.9G 8.4M 7.9G 1% /runtmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup/dev/mapper/locvg01-lvg01fs01 295G 80G 202G 29% /data01/dev/vda1 509M 110M 399M 22% /boottmpfs 1.6G 0 1.6G 0% /run/user/0[root@host-10-1-236-107 ~]#
已经做过硬盘并挂载的情况下 进行热扩容
猜你喜欢
转载自blog.csdn.net/wjlzwjl/article/details/80354839
今日推荐
周排行