![如何调整“ubuntu--vg-ubuntu--lv”的大小以使用 sda3 中的所有空间?](https://linux22.com/image/1023656/%E5%A6%82%E4%BD%95%E8%B0%83%E6%95%B4%E2%80%9Cubuntu--vg-ubuntu--lv%E2%80%9D%E7%9A%84%E5%A4%A7%E5%B0%8F%E4%BB%A5%E4%BD%BF%E7%94%A8%20sda3%20%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E7%A9%BA%E9%97%B4%EF%BC%9F.png)
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 384M 1.1M 383M 1% /run
**/dev/mapper/ubuntu--vg-ubuntu--lv 196G 16G 171G 9% /** primary partition here
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/loop1 33M 33M 0 100% /snap/snapd/12398
/dev/loop2 68M 68M 0 100% /snap/lxd/20326
/dev/loop4 33M 33M 0 100% /snap/snapd/12159
/dev/loop0 56M 56M 0 100% /snap/core18/2074
/dev/loop5 56M 56M 0 100% /snap/core18/2066
/dev/loop3 70M 70M 0 100% /snap/lxd/19188
/dev/sda2 976M 203M 707M 23% /boot
tmpfs 384M 0 384M 0% /run/user/1000
对阵
myuser@ubuntu20:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
loop0 7:0 0 55.5M 1 loop /snap/core18/2074
loop1 7:1 0 32.3M 1 loop /snap/snapd/12398
loop2 7:2 0 67.6M 1 loop /snap/lxd/20326
loop3 7:3 0 69.9M 1 loop /snap/lxd/19188
loop4 7:4 0 32.3M 1 loop /snap/snapd/12159
loop5 7:5 0 55.4M 1 loop /snap/core18/2066
sda 8:0 0 800G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 799G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 199G 0 lvm /
sr0 11:0 1 1024M 0 rom
我该如何做ubuntu--vg-ubuntu--lv
消耗全部 799 GB?
答案1
尝试
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
然后通过运行调整 fs 的大小
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv