当前位置: 首页 > news >正文

ubuntu新增磁盘扩展LV卷

登录平台

login as: wqbboy
wqbboy@172.17.2.86's password:
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-153-generic x86_64)* Documentation:  https://help.ubuntu.com* Management:     https://landscape.canonical.com* Support:        https://ubuntu.com/proSystem information as of Tue Sep  9 02:55:55 AM UTC 2025System load:  1.36               Processes:               198Usage of /:   63.6% of 23.16GB   Users logged in:         0Memory usage: 53%                IPv4 address for enp0s3: 172.17.2.86Swap usage:   0%* Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8sjust raised the bar for easy, resilient and secure K8s cluster deployment.https://ubuntu.com/engage/secure-kubernetes-at-the-edgeExpanded Security Maintenance for Applications is not enabled.54 updates can be applied immediately.
To see these additional updates run: apt list --upgradableEnable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro statusNew release '24.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.Last login: Tue Sep  9 02:55:56 2025
wqbboy@mail:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              392M  1.2M  390M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   24G   15G  7.3G  68% /
tmpfs                              2.0G  316K  2.0G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  130M  1.7G   8% /boot
tmpfs                              392M  4.0K  392M   1% /run/user/1000

查看内存、磁盘


wqbboy@mail:~$ free -mtotal        used        free      shared  buff/cache   available
Mem:            3911        2059         786           5        1065        1617
Swap:           3910           0        3910
wqbboy@mail:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0                       7:0    0   87M  1 loop /snap/lxd/29351
loop1                       7:1    0 63.9M  1 loop /snap/core20/2318
loop2                       7:2    0 89.4M  1 loop /snap/lxd/31333
loop3                       7:3    0 63.8M  1 loop /snap/core20/2599
loop4                       7:4    0 38.8M  1 loop /snap/snapd/21759
loop5                       7:5    0 50.8M  1 loop /snap/snapd/25202
sda                         8:0    0 25.7G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    2G  0 part /boot
└─sda3                      8:3    0 23.7G  0 part└─ubuntu--vg-ubuntu--lv 253:0    0 23.7G  0 lvm  /
sdb                         8:16   0 62.5G  0 disk
sr0                        11:0    1 1024M  0 rom

新增磁盘,创建PV


wqbboy@mail:~$ sudo pvcreate /dev/sdb
[sudo] password for wqbboy:Physical volume "/dev/sdb" successfully created.
wqbboy@mail:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0                       7:0    0   87M  1 loop /snap/lxd/29351
loop1                       7:1    0 63.9M  1 loop /snap/core20/2318
loop2                       7:2    0 89.4M  1 loop /snap/lxd/31333
loop3                       7:3    0 63.8M  1 loop /snap/core20/2599
loop4                       7:4    0 38.8M  1 loop /snap/snapd/21759
loop5                       7:5    0 50.8M  1 loop /snap/snapd/25202
sda                         8:0    0 25.7G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    2G  0 part /boot
└─sda3                      8:3    0 23.7G  0 part└─ubuntu--vg-ubuntu--lv 253:0    0 23.7G  0 lvm  /
sdb                         8:16   0 62.5G  0 disk
sr0                        11:0    1 1024M  0 rom

扩展vg

wqbboy@mail:~$ sudo vgextend ubuntu-vg /dev/sdbVolume group "ubuntu-vg" successfully extended
wqbboy@mail:~$ sudo vg
sudo: vg: command not found
wqbboy@mail:~$ sudo vgdisplay--- Volume group ---VG Name               ubuntu-vgSystem IDFormat                lvm2Metadata Areas        2Metadata Sequence No  3VG Access             read/writeVG Status             resizableMAX LV                0Cur LV                1Open LV               1Max PV                0Cur PV                2Act PV                2VG Size               86.15 GiBPE Size               4.00 MiBTotal PE              22055Alloc PE / Size       6066 / <23.70 GiBFree  PE / Size       15989 / <62.46 GiBVG UUID               xtkRsn-Oe4t-ue9p-b79w-wAN0-jyb6-YruPju

扩展LV全部空间


wqbboy@mail:~$ sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvSize of logical volume ubuntu-vg/ubuntu-lv changed from <23.70 GiB (6066 extents) to 86.15 GiB (22055 extents).Logical volume ubuntu-vg/ubuntu-lv successfully resized.
wqbboy@mail:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              392M  1.2M  390M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   24G   15G  7.3G  68% /
tmpfs                              2.0G  320K  2.0G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  130M  1.7G   8% /boot
tmpfs                              392M  4.0K  392M   1% /run/user/1000
wqbboy@mail:~$ sudo lvdisplay--- Logical volume ---LV Path                /dev/ubuntu-vg/ubuntu-lvLV Name                ubuntu-lvVG Name                ubuntu-vgLV UUID                SV4Jlf-XwHf-DrsR-RwLr-buep-Tt6X-aKSaQQLV Write Access        read/writeLV Creation host, time ubuntu-server, 2025-09-06 23:41:51 +0000LV Status              available# open                 1LV Size                86.15 GiBCurrent LE             22055Segments               2Allocation             inheritRead ahead sectors     auto- currently set to     256Block device           253:0wqbboy@mail:~$ sudo vgdisplay--- Volume group ---VG Name               ubuntu-vgSystem IDFormat                lvm2Metadata Areas        2Metadata Sequence No  4VG Access             read/writeVG Status             resizableMAX LV                0Cur LV                1Open LV               1Max PV                0Cur PV                2Act PV                2VG Size               86.15 GiBPE Size               4.00 MiBTotal PE              22055Alloc PE / Size       22055 / 86.15 GiBFree  PE / Size       0 / 0VG UUID               xtkRsn-Oe4t-ue9p-b79w-wAN0-jyb6-YruPjuwqbboy@mail:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0                       7:0    0   87M  1 loop /snap/lxd/29351
loop1                       7:1    0 63.9M  1 loop /snap/core20/2318
loop2                       7:2    0 89.4M  1 loop /snap/lxd/31333
loop3                       7:3    0 63.8M  1 loop /snap/core20/2599
loop4                       7:4    0 38.8M  1 loop /snap/snapd/21759
loop5                       7:5    0 50.8M  1 loop /snap/snapd/25202
sda                         8:0    0 25.7G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    2G  0 part /boot
└─sda3                      8:3    0 23.7G  0 part└─ubuntu--vg-ubuntu--lv 253:0    0 86.2G  0 lvm  /
sdb                         8:16   0 62.5G  0 disk
└─ubuntu--vg-ubuntu--lv   253:0    0 86.2G  0 lvm  /
sr0                        11:0    1 1024M  0 rom

刷新LV卷


wqbboy@mail:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 11
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 22584320 (4k) blocks long.wqbboy@mail:~$ sudo vgdisplay--- Volume group ---VG Name               ubuntu-vgSystem IDFormat                lvm2Metadata Areas        2Metadata Sequence No  4VG Access             read/writeVG Status             resizableMAX LV                0Cur LV                1Open LV               1Max PV                0Cur PV                2Act PV                2VG Size               86.15 GiBPE Size               4.00 MiBTotal PE              22055Alloc PE / Size       22055 / 86.15 GiBFree  PE / Size       0 / 0VG UUID               xtkRsn-Oe4t-ue9p-b79w-wAN0-jyb6-YruPjuwqbboy@mail:~$ sudo lvdisplay--- Logical volume ---LV Path                /dev/ubuntu-vg/ubuntu-lvLV Name                ubuntu-lvVG Name                ubuntu-vgLV UUID                SV4Jlf-XwHf-DrsR-RwLr-buep-Tt6X-aKSaQQLV Write Access        read/writeLV Creation host, time ubuntu-server, 2025-09-06 23:41:51 +0000LV Status              available# open                 1LV Size                86.15 GiBCurrent LE             22055Segments               2Allocation             inheritRead ahead sectors     auto- currently set to     256Block device           253:0

查看空间


wqbboy@mail:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              392M  1.2M  390M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   85G   15G   67G  19% /
tmpfs                              2.0G  320K  2.0G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  130M  1.7G   8% /boot
tmpfs                              392M  4.0K  392M   1% /run/user/1000
wqbboy@mail:~$

防火墙设置

curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to download.docker.com:443
解决办法
sudo ufw allow 443/tcp

文章转载自:

http://v0l1DLOs.kmcfw.cn
http://dVCvlAPK.kmcfw.cn
http://8TKaCJrF.kmcfw.cn
http://Rc8uylNu.kmcfw.cn
http://JmeS5NmT.kmcfw.cn
http://luP9DTTX.kmcfw.cn
http://LAeSFZoE.kmcfw.cn
http://LXGGbPYz.kmcfw.cn
http://sZ8iF7WM.kmcfw.cn
http://Oza61H26.kmcfw.cn
http://pbJbFm4O.kmcfw.cn
http://lJQijCxk.kmcfw.cn
http://eSsuSD7m.kmcfw.cn
http://BHXD3IQn.kmcfw.cn
http://5EwxS2jh.kmcfw.cn
http://MVZ0A5CV.kmcfw.cn
http://6RBCyBTJ.kmcfw.cn
http://E80TEanA.kmcfw.cn
http://qNazzbHK.kmcfw.cn
http://iSoLEoVf.kmcfw.cn
http://bljRcq8n.kmcfw.cn
http://jmpdLMMC.kmcfw.cn
http://3lscNkq1.kmcfw.cn
http://FuxoZ3fP.kmcfw.cn
http://vS5gudB9.kmcfw.cn
http://gBsr6PhA.kmcfw.cn
http://zOnEl1am.kmcfw.cn
http://2EAdceKf.kmcfw.cn
http://cBVoKjtp.kmcfw.cn
http://GcyFI1pU.kmcfw.cn
http://www.dtcms.com/a/375512.html

相关文章:

  • PowerApps 使用Xrm.Navigation.navigateTo无法打开CustomPage的问题
  • C/C++中基本数据类型在32位/64位系统下的大小
  • TensorFlow 和 PyTorch两大深度学习框架训练数据,并协作一个电商推荐系统
  • ceph scrub 参数
  • JavaWeb--day1--HTMLCSS
  • 全国连锁贸易公司数字化管理软件-优德普SAP零售行业解决方案
  • C++面向对象之继承
  • AI原生编程:智能系统自动扩展术
  • Wireshark TS | 接收数据超出接收窗口
  • 第一代:嵌入式本地状态(Flink 1.x)
  • 4.1-中间件之Redis
  • Django ModelForm:快速构建数据库表单
  • 【迭代】:本地高性能c++对话系统e2e_voice
  • SSE与Websocket、Http的关系
  • 蓓韵安禧DHA展现温和配方的藻油与鱼油营养特色
  • 基于UNet的视网膜血管分割系统
  • python函数和面向对象
  • 嵌入式 - ARM(3)从基础调用到 C / 汇编互调
  • 07MySQL存储引擎与索引优化
  • 面向OS bug的TypeState分析
  • 【文献笔记】Task allocation for multi-AUV system: A review
  • 小红书批量作图软件推荐运营大管家小红书批量作图工具
  • ArrayList详解与实际应用
  • 德意志飞机公司与DLR合作完成D328 UpLift演示机地面振动测试
  • MongoDB 备份与恢复终极指南:mongodump 和 mongorestore 深度实战
  • ctfshow - web - 命令执行漏洞总结(二)
  • 基于STM32的GPS北斗定位系统
  • 2025年大陆12寸晶圆厂一览
  • VMware Workstation Pro 安装教程
  • Java Spring @Retention三种保留策略