
이전 컴퓨터에서 LVM-on-LUKS 파티션을 전송하고 223GB를 모두 사용하도록 크기를 거의 조정했습니다.
두 개의 LVM 파티션이 있는 일반적인 Ubuntu 설치입니다.
~#lsblk
...
└─sda5 8:5 0 223G 0 part
└─luks-a8df437a-7906-4574-a6ff-16e337f8cb19 252:0 0 223G 0 crypt
├─szop--vg-root 252:1 0 146.6G 0 lvm
└─szop--vg-swap_1 252:2 0 2G 0 lvm
...
또한 전체 크기를 차지하는 PV와 VG도 있습니다.
~# pv디스플레이
--- Physical volume ---
PV Name /dev/mapper/luks-a8df437a-7906-4574-a6ff-16e337f8cb19
VG Name szop-vg
PV Size 223.04 GiB / not usable 1.84 MiB
Allocatable NO
PE Size 4.00 MiB
Total PE 57097
Free PE 19064
Allocated PE 38033
PV UUID oxRbRw-P8xz-wTM9-1p1n-UkP7-zknB-31AHLR
~# vgdisplay
--- Volume group ---
VG Name szop-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 20
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 223.04 GiB
PE Size 4.00 MiB
Total PE 57097
Alloc PE / Size 38033 / 148.57 GiB
Free PE / Size 19064 / 74.47 GiB
VG UUID IFezjq-rKPJ-Ydko-JV9P-l8RM-4oX8-Tijx9w
이 일반적인 Ubuntu 설치에는 두 개의 LV가 있습니다.
~# lv디스플레이
--- Logical volume ---
LV Path /dev/szop-vg/root
LV Name root
VG Name szop-vg
LV UUID a7BeRt-5STg-gbsr-cBES-h2q8-P0yT-nuK2Ic
LV Write Access read/write
LV Creation host, time szop, 2016-08-07 16:39:48 +0000
LV Status available
# open 0
LV Size 146.59 GiB
Current LE 37528
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
--- Logical volume ---
LV Path /dev/szop-vg/swap_1
LV Name swap_1
VG Name szop-vg
LV UUID On2jUZ-UTqF-3AxH-YkVq-DYPn-dbUA-2cq3iy
LV Write Access read/write
LV Creation host, time szop, 2016-08-07 16:39:49 +0000
LV Status available
# open 0
LV Size 1.97 GiB
Current LE 505
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:2
남은 공간을 사용하기 위해 루트 파티션의 크기를 조정하고 싶습니다.
~# lvresize -L +10G /dev/mapper/szop--vg-root
Insufficient free space: 2560 extents needed, but only 0 available
왜 이 오류가 발생하나요?
답변1
Allocatable yes
다음을 사용하여 내 PV를 다음으로 표시해야 했습니다 pvchange
.
~# pvchange -xy /dev/mapper/szop--vg-root
Physical volume "/dev/mapper/luks-a8df437a-7906-4574-a6ff-16e337f8cb19" changed
1 physical volume changed / 0 physical volumes not changed
그 후 LV 크기를 성공적으로 조정할 수 있었습니다.