Ubuntu

調整虛擬 Ubuntu 伺服器的大小

  • August 3, 2021

我有一個 Ubuntu Server 的虛擬實例正在執行。將虛擬磁碟從 37GB 增加到 50GB,但現在堅持為 LVM 獲取額外空間。

我嘗試了 lvextend 和 resize2fs ,結果如下;

sudo lvextend -L +14G /dev/ubuntu-vg/ubuntu-lv
Insufficient free space: 3584 extents needed, but only 0 available

sudo resize2fs -p /dev/ubuntu-vg/ubuntu-lv 
The filesystem is already 9042944 (4k) blocks long.  Nothing to do!

sudo lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0                       7:0    0 55.4M  1 loop /snap/core18/2066
loop1                       7:1    0 70.3M  1 loop /snap/lxd/21029
loop2                       7:2    0 67.6M  1 loop /snap/lxd/20326
loop3                       7:3    0 32.3M  1 loop /snap/snapd/12704
loop4                       7:4    0 55.5M  1 loop /snap/core18/2074
loop5                       7:5    0 32.3M  1 loop /snap/snapd/12398
sda                         8:0    0   50G  0 disk
├─sda1                      8:1    0  512M  0 part /boot/efi
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0 48.5G  0 part
 └─ubuntu--vg-ubuntu--lv 253:0    0 34.5G  0 lvm  /
sr0                        11:0    1 1024M  0 rom

我在哪一步完全空白?

你忘了pvresize /dev/sda3

引用自:https://serverfault.com/questions/1073447