1:.首先查看我们的根分区大小是多少

 df -h
文件系统                类型      容量  已用  可用 已用% 挂载点
/dev/mapper/centos-root xfs        18G  1.1G   17G    6% /
devtmpfs                devtmpfs  479M     0  479M    0% /dev
tmpfs                   tmpfs     489M     0  489M    0% /dev/shm
tmpfs                   tmpfs     489M  6.7M  483M    2% /run
tmpfs                   tmpfs     489M     0  489M    0% /sys/fs/cgroup
/dev/sda1               xfs       497M  125M  373M   25% /boot
tmpfs                   tmpfs      98M     0   98M    0% /run/user/0
 
2:在虚拟机中添加一块物理的磁盘,重起虚拟机。
3:查看磁盘编号
ls /dev/sd*

/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb

4:创建pv

pvcreate /dev/sdb

Physical volume "/dev/sdb" successfully created

5:把pv加入vg中,相当于扩充vg的大小

先使用vgs查看vg组

vgs

VG #PV #LV #SN Attr VSize VFree
centos 2 2 0 wz--n- 59.50g 20.04g

扩展vg,使用vgextend命令

 vgextend centos /dev/sdb

6 :我们成功把vg卷扩展了,在用vgs查看一下

vgs
VG     #PV #LV #SN Attr   VSize  VFree
centos   2   2   0 wz--n- 39.50g 20.04g
lvs

LV   VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert

  root centos -wi-ao---- 17.47g                                                   
  swap centos -wi-ao----  2.00g  虽然我们把vg扩展了,但是lv还没有扩展
 
7:扩展lv,使用lvextend命令
lvextend -L +20G /dev/mapper/centos-root
Size of logical volume centos/root changed from 17.47 GiB (4472 extents) to 37.47 GiB (9592 extents).
Logical volume root successfully resized
 
8: 命令使系统重新读取大小
xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=256    agcount=4, agsize=1144832 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=4579328, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 4579328 to 9822208
 
9:再使用df  -h查看
df -h
文件系统                 容量  已用  可用 已用% 挂载点
/dev/mapper/centos-root   38G  1.1G   37G    3% /
devtmpfs                 479M     0  479M    0% /dev
tmpfs                    489M     0  489M    0% /dev/shm
tmpfs                    489M  6.7M  483M    2% /run
tmpfs                    489M     0  489M    0% /sys/fs/cgroup
/dev/sda1                497M  125M  373M   25% /boot
tmpfs                     98M     0   98M    0% /run/user/0
 

虚拟机扩容(/dev/mapper/centos-root 空间不足)的更多相关文章

  1. CentOS7根目录磁盘扩容(/dev/mapper/centos-root 空间不足)

    今天在给测试环境搭建k8s系统时,发现master根目录磁盘空间不足,需要扩容,记录如下. # 查看根分区大小 [root@master ~]# df -h Filesystem Size Used ...

  2. 运行R 报错R cannot R_TempDir, 继而发现/dev/mapper/VG00-LV01 磁盘空间已满

    今天在运行R脚本的时候报了个错:Fatal error: cannot create 'R_TempDir'.排除了是自己写的代码的问题,想着应该是某个没见过的原因,google之,发现网上的说法是/ ...

  3. linux 逻辑卷管理 /dev/mapper/VolGroup-lv_root 100%调整分区大小

    1.解决过程 # df -h   // 查看分区 # umount /home   // 取消挂载 # e2fsck -f /dev/mapper/VolGroup-lv_home   // 分区检测 ...

  4. Linux Centos虚拟机扩容(/dev/mapper/centos-root)

    1:.首先查看我们的根分区大小是多少 df -h 文件系统 类型 容量 已用 可用 已用% 挂载点 /dev/mapper/centos-root xfs 18G 1.1G 17G 6% / devt ...

  5. 虚拟机 /dev/mapper/centos-root 动态扩容

    [root@bogon ~]# df -h Filesystem Size Used Avail Use% Mounted on .2G .2G 51M % / devtmpfs 908M 908M ...

  6. CentOS 7 Vmware虚拟机 /root空间不足解决方法(使用gparted live)

    1,关闭虚拟机,编辑虚拟机设置,增加虚拟磁盘的大小,我这里增加10GB 2,连接CDrom到ISO文件(gparted-live-0.19.0-1-i486.iso),使用gparted live启动 ...

  7. OpenStack中的虚拟机(/dev/mapper/centos-root)进行磁盘扩容

    一.虚拟机上先扩展分区: 二.centos系统root登入,新建分区 2.1 [fdisk -l] 最大分区为/dev/sda2,说明新创建的分区将会是sda3(在后面的步骤会进行选择) 2.2 输入 ...

  8. Linux Centos虚拟机扩容

    Linux Centos虚拟机扩容(/dev/mapper/centos-root) 1:.首先查看我们的根分区大小是多少 df -h 文件系统 类型 容量 已用 可用 已用% 挂载点``/dev/m ...

  9. 虚拟机中CentOS-7.9的硬盘空间扩容(EXSI)

    目录 一.增加虚机容量 二.创建新的分区 三.格式化新分区 四.lvm实现卷扩容 五.文件系统的扩容 大家好,我是LSF,发现一台虚机上 /dev/mapper/centos-root Use%已经快 ...

随机推荐

  1. 国外物联网平台(2):微软Azure IoT

    国外物联网平台(2)——微软Azure IoT 马智 平台定位 连接设备.其它 M2M 资产和人员,以便在业务和操作中更好地利用数据. 连接 IoT 设备 将所有设备连接到云,从这些设备接收大规模数据 ...

  2. Hyper-V 中遇到错误 'vm' could not initialize

    不知道前面做了什么操作,但当我启动我的虚拟机时遇到了'vm' could not initialize的错误,如下图: 在几番尝试未果后,找到了如下解决方法: 以管理员模式启动cmd,执行命令 net ...

  3. Kotlin第一篇 Hello Kotlin以及简单介绍。

    首先需要一个编译器,我们使用Intellij IDE  https://www.jetbrains.com/idea/download/#section=windows 下载下来安装好. 那么我们就来 ...

  4. 「BZOJ 1297」「SCOI 2009」迷路「矩阵乘法」

    题意 边权\(w \in [1, 9]\)的\(n\)个结点的有向图,图上从\(1\)到\(n\)长度为\(d\)的路径计数,\(n \leq 10\). 题解 如果边权为\(1\)很经典,设\(f[ ...

  5. nginx添加缓存以及判断是否缓存生效

    location ~.*\.(js|css|html|png|jpg|gif)$ { expires 3d; } expires    3d; //表示缓存3天 expires    3h; //表示 ...

  6. P2488 [SDOI2011]工作安排 费用流

    \(\color{#0066ff}{ 题目描述 }\) 你的任务是制定出一个产品的分配方案,使得订单条件被满足,并且所有员工的愤怒值之和最小.由于我们并不想使用Special Judge,也为了使选手 ...

  7. netty结合websocket使用

    首先需要在后台建立netty服务器启动类; package com.cxy; import io.netty.bootstrap.ServerBootstrap; import io.netty.ch ...

  8. redis启动后出现"WARNING you have Transparent Huge Pages (THP) support enabled in your kernel"问题

    问题描述:启动redis后出现:WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This w ...

  9. postgresql 如何设置主键自增

    法一: CREATE TABLE customers ( customerid SERIAL primary key , companyname character varying, contactn ...

  10. 分页插件PageHelper

    一.PageHelper说明 如果你也在用Mybatis,建议尝试该分页插件,这个一定是最方便使用的分页插件. 该插件目前支持Oracle,Mysql,MariaDB,SQLite,Hsqldb,Po ...