ubuntu20.04 server 安装后磁盘空间只有一半的处理

这里扩展:/dev/mapper/ubuntu--vg-ubuntu--lv

bash 复制代码
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/0

root@book:/data# sudo vgdisplay
  --- Volume group ---
  VG Name               ubuntu-vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <98.00 GiB
  PE Size               4.00 MiB
  Total PE              25087
  Alloc PE / Size       12543 / <49.00 GiB
  Free  PE / Size       12544 / 49.00 GiB
  VG UUID               Mk5zlb-zqJO-3KgW-FbJ0-Q253-8msJ-0sGMYy

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/0

root@book:/data# sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
  Size 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/0

root@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
相关推荐
文杰一米八6 小时前
在Ubuntu上安装RabbitMQ教程
ubuntu·rabbitmq
GIS小小研究僧16 小时前
数据库基础知识:理论、E-R图、事务、原则
数据库·ubuntu·postgresql
牛马大师兄1 天前
网络编程 | UDP组播通信
linux·网络·c++·网络协议·ubuntu·udp
丿无缘梦丨1 天前
ubuntu,vmware虚拟机共享文件夹配置
linux·ubuntu
小志biubiu1 天前
编辑器Vim基本模式和指令 --【Linux基础开发工具】
linux·服务器·ubuntu·centos·编辑器·vim·vi
张3蜂2 天前
Ubuntu安装docker
ubuntu·docker·eureka
小白也有IT梦2 天前
Ubuntu 完整卸载 WPS Office (deb包安装版)
linux·ubuntu·wps
玩电脑的辣条哥2 天前
Ubuntu如何安装redis服务?
linux·redis·ubuntu
bohu832 天前
亚博microros小车-原生ubuntu支持系列:1 键盘控制
python·ubuntu·ros2·话题通信·microros·亚博
江湖一码农2 天前
[实战]Ubuntu使用工具和命令无法ssh,但使用另一台Ubuntu机器可以用命令ssh,非root用户。
linux·ubuntu·ssh