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
相关推荐
oushaojun23 小时前
ubuntu中使用ffmpeg和nginx推流rtmp视频
nginx·ubuntu·ffmpeg·rtmp
命里有定数7 小时前
Ubuntu问题 -- 通过远程修改文件配置ubuntu服务器的静态IP (不需要到服务器现场) (通过NetworkManager)
运维·服务器·tcp/ip·ubuntu·网卡
命里有定数10 小时前
Ubuntu问题 - 显示ubuntu服务器上可用磁盘空间 一条命令df -h
服务器·ubuntu·数据集
命里有定数14 小时前
Ubuntu问题 -- 设置ubuntu的IP为静态IP (图形化界面设置) 小白友好
linux·tcp/ip·ubuntu·ip
基极向上的三极管16 小时前
【Linux学习】【Ubuntu入门】1-8 ubuntu下压缩与解压缩
linux·ubuntu
云计算运维丁丁18 小时前
Linux四剑客及正则表达式
linux·运维·服务器·ubuntu
sun00770021 小时前
Ubuntu networkmanager
linux·运维·ubuntu
xx小寂21 小时前
ubuntu16.04在ros使用USB摄像头-解决could not open /dev/video0问题
ubuntu·机器人
柳鲲鹏1 天前
全网首发:Ubuntu编译跨平台嵌入式支持ffmpeg的OpenCV
linux·ubuntu·ffmpeg
weixin_443290691 天前
【终端美化】Ubuntu 下 Zsh 与 Oh-My-Zsh 美化与插件配置指南
linux·运维·ubuntu