
가상 서버의 디스크 크기를 20GB -> 80GB로 확장해 달라고 요청했습니다.
그 후 디스크 크기가 /dev/sda
80GiB로 늘어났습니다. 그러나 크기는 /dev/sda2
19.5GiB로 변경되지 않았습니다.
root@localhost:/home/worker# fdisk -l
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Disk model: Virtual disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x520f1760
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 999424 41943039 40943616 19.5G 8e Linux LVM
Disk /dev/mapper/vg00-lv00: 1.93 GiB, 2046820352 bytes, 3997696 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/vg00-lv01: 17.63 GiB, 18912116736 bytes, 36937728 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
다음 명령을 사용하여 이 문제를 해결할 수 있습니다 growpart
.
root@localhost:# growpart /dev/sda 2
CHANGED: partition=2 start=999424 old: size=40943616 end=41943040 new: size=166772703 end=167772127
root@localhost:/home/worker# fdisk -l
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Disk model: Virtual disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x520f1760
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 999424 167772126 166772703 79.5G 8e Linux LVM
그러나 내 파일 시스템에는 여전히 공간이 충분하지 않습니다.
root@localhost:# df -h
Filesystem Size Used Avail Use% Mounted on
udev 947M 0 947M 0% /dev
tmpfs 196M 928K 195M 1% /run
/dev/mapper/vg00-lv01 18G 17G 180M 99% /
tmpfs 977M 20K 977M 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 977M 0 977M 0% /sys/fs/cgroup
/dev/sda1 456M 147M 276M 35% /boot
tmpfs 196M 0 196M 0% /run/user/1000
Google에서 나는 어떻게든 파티션을 늘려야 한다는 것을 이해합니다. 그러나 웹에서 'ext4' 또는 다른 유형에서 이 작업을 수행하는 방법에 대한 정보를 찾았습니다. 제 경우에는 유형이 LVM2_member
. 나는 그것을 어떻게 처리해야할지 모르겠습니다.
root@localhost:# blkid
/dev/mapper/vg00-lv00: UUID="d236bafc-c18c-49aa-816d-85f0c7afc810" TYPE="swap"
/dev/mapper/vg00-lv01: UUID="77ae49d6-38e3-44c5-a20b-e10972c8ee21" TYPE="ext4"
/dev/sda1: UUID="de2cb53e-6086-4fd5-99a9-1c22674a4f91" TYPE="ext4" PARTUUID="520f1760-01"
/dev/sda2: UUID="R5VWXg-jamB-5dWM-PpwY-7a49-LRz7-Vrvdl2" TYPE="LVM2_member" PARTUUID="520f1760-02"
lvextend
나는 아무 효과도 없이 시도했습니다 .
root@localhost:/home/worker#df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 969104 0 969104 0% /dev
tmpfs 199936 928 199008 1% /run
/dev/mapper/vg00-lv01 18114384 17097768 183380 99% /
tmpfs 999668 20 999648 1% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 999668 0 999668 0% /sys/fs/cgroup
/dev/sda1 466664 149872 281888 35% /boot
tmpfs 199932 0 199932 0% /run/user/1000
root@localhost:/home/worker# lvextend -l +100%FREE /dev/mapper/vg00-lv01
New size (4509 extents) matches existing size (4509 extents).
root@localhost:/home/worker# df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 969104 0 969104 0% /dev
tmpfs 199936 928 199008 1% /run
/dev/mapper/vg00-lv01 18114384 17097788 183360 99% /
tmpfs 999668 20 999648 1% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 999668 0 999668 0% /sys/fs/cgroup
/dev/sda1 466664 149872 281888 35% /boot
tmpfs 199932 0 199932 0% /run/user/1000
더 많은 정보
root@localhost:# vgdisplay -v vg00
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
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 <19.52 GiB
PE Size 4.00 MiB
Total PE 4997
Alloc PE / Size 4997 / <19.52 GiB
Free PE / Size 0 / 0
VG UUID ZRC0sL-qOeU-Uyfp-Qbo4-m06c-CwEt-xpFTsO
--- Logical volume ---
LV Path /dev/vg00/lv00
LV Name lv00
VG Name vg00
LV UUID fQt2D5-OofH-m0yQ-jRP8-MJog-gcKp-3GhTa4
LV Write Access read/write
LV Creation host, time somehost, 2021-05-20 11:12:52 +0000
LV Status available
# open 2
LV Size <1.91 GiB
Current LE 488
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg00/lv01
LV Name lv01
VG Name vg00
LV UUID e3zugo-eu0a-gWgm-ULmN-LstF-tdNg-3uMPWZ
LV Write Access read/write
LV Creation host, time somehost, 2021-05-20 11:12:52 +0000
LV Status available
# open 1
LV Size 17.61 GiB
Current LE 4509
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Physical volumes ---
PV Name /dev/sda2
PV UUID R5VWXg-jamB-5dWM-PpwY-7a49-LRz7-Vrvdl2
PV Status allocatable
Total PE / Free PE 4997 / 0
그리고
root@localhost:#lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
도움을 주셔서 감사합니다.
답변1
지원팀에 문의한 후 해결 방법을 찾았습니다. https://www.ionos.de/hilfe/index.php?id=4315
기본적으로 적용하기 전에 단계 pvresize /dev/sda2
가 누락되었습니다 lvextend
.
지금 해결되었습니다.