admin 发表于 2020-6-5 15:33:16

NOCHANGE: partition 2 is size 61884492. it cannot be grown

NOCHANGE: partition 2 is size 61884492. it cannot be grown

admin 发表于 2020-6-5 15:40:46

检查磁盘序列号:
重新执行命令。

# lsblk
NAME                        MAJ:MIN RMSIZE RO TYPE MOUNTPOINT
sda                           8:0    0   30G0 disk
├─sda1                        8:1    0500M0 part /boot
└─sda2                        8:2    0 29.5G0 part
├─vg_centos6-lv_root (dm-0) 253:0    0 17.5G0 lvm/
└─vg_centos6-lv_swap (dm-1) 253:1    0    2G0 lvm
# growpart /dev/sda 2
NOCHANGE: partition 2 is size 61884492. it cannot be grown
# growpart /dev/vda 2
FAILED: /dev/vda: does not exist
# growpart sda 2
FAILED: sda: does not exist
# growpart /dev/sda 2
NOCHANGE: partition 2 is size 61884492. it cannot be grown
# pvscan
PV /dev/sda2   VG vg_centos6   lvm2
Total: 1 / in use: 1 / in no VG: 0
# pvdisplay
--- Physical volume ---
PV Name               /dev/sda2
VG Name               vg_centos6
PV Size               19.51 GiB / not usable 2.00 MiB
Allocatable         yes (but full)
PE Size               4.00 MiB
Total PE            4994
Free PE               0
Allocated PE          4994
PV UUID               pgq4gQ-kvRN-TT7t-tqJU-2Gvx-ZHTB-v7te0K
   
# pvresize /dev/
Display all 170 possibilities? (y or n)
# pvresize /dev/sda
sda   sda1sda2
# pvresize /dev/sda2
Physical volume "/dev/sda2" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
# pvdisplay
--- Physical volume ---
PV Name               /dev/sda2
VG Name               vg_centos6
PV Size               29.51 GiB / not usable 986.00 KiB
Allocatable         yes
PE Size               4.00 MiB
Total PE            7554
Free PE               2560
Allocated PE          4994
PV UUID               pgq4gQ-kvRN-TT7t-tqJU-2Gvx-ZHTB-v7te0K
   
# vgdisplay
--- Volume group ---
VG Name               vg_centos6
System ID            
Format                lvm2
Metadata Areas      1
Metadata Sequence No9
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               29.51 GiB
PE Size               4.00 MiB
Total PE            7554
Alloc PE / Size       4994 / 19.51 GiB
FreePE / Size       2560 / 10.00 GiB
VG UUID               JXzUoA-nRhV-4oNN-Fisv-M7OW-R6ok-nsxFia
   

admin 发表于 2020-6-5 15:42:43

# lvextend -l +100%FREE /dev/mapper/vg_centos6-lv_root
Extending logical volume lv_root to 27.51 GiB
Logical volume lv_root successfully resized

重新检查设备空间大小,即可;

admin 发表于 2020-6-5 15:45:31

resize下磁盘空间:
# resize2fs -f /dev/mapper/vg_centos6-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_centos6-lv_root is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/mapper/vg_centos6-lv_root to 7211008 (4k) blocks.
The filesystem on /dev/mapper/vg_centos6-lv_root is now 7211008 blocks long.
页: [1]
查看完整版本: NOCHANGE: partition 2 is size 61884492. it cannot be grown