Ubuntu 20 운영 체제를 실행하는 서버는 Xen 가상화에서 확장할 수 없습니다.
250GB 디스크 공간을 265GB로 업데이트했는데, 명령 화면에서 아무리 해도 여유 공간이 전혀 표시되지 않습니다.
데이터를 삭제하거나 디스크를 포맷하지 않고 확장하는 방법.
lvextend -l +100%FREE /dev/mapper/vg0-lv--0
New size (63999 extents) matches existing size (63999 extents).
resize2fs /dev/vg0/lv-0
The filesystem is already 65534976 (4k) blocks long. Nothing to do!
fdisk
Disk /dev/xvdb: 265 GiB, 284541583360 bytes, 555745280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vg0-lv--0: 249.102 GiB, 268431261696 bytes, 524279808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
lsbk
xvdb 202:16 0 265G 0 disk
└─vg0-lv--0 253:0 0 250G 0 lvm /disk1
vgs
VG #PV #LV #SN Attr VSize VFree
vg0 1 1 0 wz--n- <250.00g 0
lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv-0 vg0 -wi-ao---- <250.00g
pvs
PV VG Fmt Attr PSize PFree
/dev/xvdb vg0 lvm2 a-- <250.00g 0
vgdisplay
--- Volume group ---
VG Name vg0
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 11
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 <250.00 GiB
PE Size 4.00 MiB
Total PE 63999
Alloc PE / Size 63999 / <250.00 GiB
Free PE / Size 0 / 0
VG UUID bLV6ef-wdHj-MnX3-1FbS-fDme-nbYA-YJmfRX
lvdisplay
--- Logical volume ---
LV Path /dev/vg0/lv-0
LV Name lv-0
VG Name vg0
LV UUID A6xPOa-YxR9-XPcJ-8MnX-Y4vr-tfxs-QkgNfC
LV Write Access read/write
LV Creation host, time ubuntu-server, 2021-02-17 13:47:36 +0300
LV Status available
# open 1
LV Size <250.00 GiB
Current LE 63999
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
df -Th
/dev/mapper/vg0-lv--0 ext4 246G 166G 70G 71% /disk1
답변1
제가 좀 너무 성급하게 생각한 것 같아요. 다음 명령을 실행하여 문제가 해결되었습니다. 동일한 문제가 발생하는 모든 사람에게 도움이 되기를 바랍니다.
pvresize /dev/xvdb
pvscan
lvextend -l +100%FREE /dev/mapper/vg0-lv--0
resize2fs /dev/mapper/vg0-lv--0