这里扩展:/dev/mapper/ubuntu–vg-ubuntu–lv
root@book:/data# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 795M 1.2M 794M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 48G 11G 35G 24% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop1 50M 50M 0 100% /snap/snapd/18357
/dev/loop2 41M 41M 0 100% /snap/snapd/19993
/dev/loop0 64M 64M 0 100% /snap/core20/1828
/dev/loop4 64M 64M 0 100% /snap/core20/2015
/dev/loop3 92M 92M 0 100% /snap/lxd/24061
/dev/sda2 2.0G 209M 1.6G 12% /boot
tmpfs 795M 0 795M 0% /run/user/0root@book:/data# sudo vgdisplay--- Volume group ---VG Name ubuntu-vgSystem IDFormat lvm2Metadata Areas 1Metadata Sequence No 2VG Access read/writeVG Status resizableMAX LV 0Cur LV 1Open LV 1Max PV 0Cur PV 1Act PV 1VG Size <98.00 GiBPE Size 4.00 MiBTotal PE 25087Alloc PE / Size 12543 / <49.00 GiBFree PE / Size 12544 / 49.00 GiBVG UUID Mk5zlb-zqJO-3KgW-FbJ0-Q253-8msJ-0sGMYyroot@book:/data# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 795M 1.2M 794M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 48G 11G 35G 24% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop1 50M 50M 0 100% /snap/snapd/18357
/dev/loop2 41M 41M 0 100% /snap/snapd/19993
/dev/loop0 64M 64M 0 100% /snap/core20/1828
/dev/loop4 64M 64M 0 100% /snap/core20/2015
/dev/loop3 92M 92M 0 100% /snap/lxd/24061
/dev/sda2 2.0G 209M 1.6G 12% /boot
tmpfs 795M 0 795M 0% /run/user/0root@book:/data# sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvSize of logical volume ubuntu-vg/ubuntu-lv changed from <49.00 GiB (12543 exte nts) to <98.00 GiB (25087 extents).Logical volume ubuntu-vg/ubuntu-lv successfully resized.root@book:/data# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 795M 1.2M 794M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 48G 11G 35G 24% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop1 50M 50M 0 100% /snap/snapd/18357
/dev/loop2 41M 41M 0 100% /snap/snapd/19993
/dev/loop0 64M 64M 0 100% /snap/core20/1828
/dev/loop4 64M 64M 0 100% /snap/core20/2015
/dev/loop3 92M 92M 0 100% /snap/lxd/24061
/dev/sda2 2.0G 209M 1.6G 12% /boot
tmpfs 795M 0 795M 0% /run/user/0root@book:/data# sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizin g required
old_desc_blocks = 7, new_desc_blocks = 13
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 25689088 (4k) blocks long.root@book:/data# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 795M 1.2M 794M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 97G 11G 82G 12% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop1 50M 50M 0 100% /snap/snapd/18357
/dev/loop2 41M 41M 0 100% /snap/snapd/19993
/dev/loop0 64M 64M 0 100% /snap/core20/1828
/dev/loop4 64M 64M 0 100% /snap/core20/2015
/dev/loop3 92M 92M 0 100% /snap/lxd/24061
/dev/sda2 2.0G 209M 1.6G 12% /boot
tmpfs 795M 0 795M 0% /run/user/0