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
相关推荐
CSND7402 小时前
Ubuntu vi(vim)编辑器配置一键补全main函数
linux·c语言·ubuntu·编辑器·vim
Joyner201814 小时前
ubuntu批量依赖库拷贝(ldd)
linux·运维·ubuntu
Jason_C_14 小时前
【NVIDIA】启动ubuntu后显卡驱动丢失
linux·运维·ubuntu
阑梦清川14 小时前
基于ubuntu的mysql 8.0安装教程
linux·mysql·ubuntu
Snow_Dragon_L14 小时前
【MySQL】表操作
linux·数据库·后端·sql·mysql·ubuntu
wkd_00715 小时前
【C++读写.xlsx文件】OpenXLSX开源库在 Ubuntu 18.04 的编译、交叉编译与使用教程
linux·ubuntu·openxlsx·c++写xlsx·开源库编译
zhy2956315 小时前
【LIBS】开源库编译之OSQP
ubuntu·cmake·osqp·libs
evan_gyy16 小时前
【VSCode】解决:提取扩展失败,XHR Failed
vscode·代理·扩展
轻口味16 小时前
配置TypeScript:tsconfig.json详解
ubuntu·typescript·json
白云千载尽19 小时前
ubuntu初始化与软件安装(持续更新)
linux·chrome·ubuntu