主要步骤:

vmware 宿主机编辑虚拟机配置扩容服务器并启动虚拟机

fdisk新建分区

pvcreate新建物理卷

vgextend扩展卷组

lvextend扩容逻辑卷

xfs_growfs扩容文件系统

1. fdisk 查看磁盘信息

[root@node01 html]# fdisk -l

磁盘 /dev/sda:107.4 GB, 107374182400 字节,209715200 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x000b41c1

设备 Boot Start End Blocks Id System

/dev/sda1 * 2048 2099199 1048576 83 Linux

/dev/sda2 2099200 33554431 15727616 8e Linux LVM

磁盘 /dev/mapper/centos_centos7-root:14.4 GB, 14382268416 字节,28090368 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘 /dev/mapper/centos_centos7-swap:1719 MB, 1719664640 字节,3358720 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

2. 查看分区

[root@node01 html]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/centos_centos7-root 14G 12G 1.8G 88% /

devtmpfs 909M 0 909M 0% /dev

tmpfs 920M 0 920M 0% /dev/shm

tmpfs 920M 8.7M 912M 1% /run

tmpfs 920M 0 920M 0% /sys/fs/cgroup

/dev/sda1 1014M 143M 872M 15% /boot

tmpfs 184M 0 184M 0% /run/user/0

tmpfs 184M 0 184M 0% /run/user/1000

[root@node01 html]# du -sh

11G.

3. fdisk新建分区

[root@node01 html]# fdisk /dev/sda

欢迎使用 fdisk (util-linux 2.23.2)。

更改将停留在内存中,直到您决定将更改写入磁盘。

使用写入命令前请三思。

命令(输入 m 获取帮助):m

命令操作

a toggle a bootable flag

b edit bsd disklabel

c toggle the dos compatibility flag

d delete a partition

g create a new empty GPT partition table

G create an IRIX (SGI) partition table

l list known partition types

m print this menu

n add a new partition

o create a new empty DOS partition table

p print the partition table

q quit without saving changes

s create a new empty Sun disklabel

t change a partition's system id

u change display/entry units

v verify the partition table

w write table to disk and exit

x extra functionality (experts only)

命令(输入 m 获取帮助):p

磁盘 /dev/sda:107.4 GB, 107374182400 字节,209715200 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x000b41c1

设备 Boot Start End Blocks Id System

/dev/sda1 * 2048 2099199 1048576 83 Linux

/dev/sda2 2099200 33554431 15727616 8e Linux LVM

命令(输入 m 获取帮助):n

Partition type:

p primary (2 primary, 0 extended, 2 free)

e extended

Select (default p): p

分区号 (3,4,默认 3):

起始 扇区 (33554432-209715199,默认为 33554432):

将使用默认值 33554432

Last 扇区, +扇区 or +size{K,M,G} (33554432-209715199,默认为 209715199):

将使用默认值 209715199

分区 3 已设置为 Linux 类型,大小设为 84 GiB

命令(输入 m 获取帮助):p

磁盘 /dev/sda:107.4 GB, 107374182400 字节,209715200 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x000b41c1

设备 Boot Start End Blocks Id System

/dev/sda1 * 2048 2099199 1048576 83 Linux

/dev/sda2 2099200 33554431 15727616 8e Linux LVM

/dev/sda3 33554432 209715199 88080384 83 Linux

命令(输入 m 获取帮助):t

分区号 (1-3,默认 3):

Hex 代码(输入 L 列出所有代码):8e

已将分区“Linux”的类型更改为“Linux LVM”

命令(输入 m 获取帮助):p

磁盘 /dev/sda:107.4 GB, 107374182400 字节,209715200 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x000b41c1

设备 Boot Start End Blocks Id System

/dev/sda1 * 2048 2099199 1048576 83 Linux

/dev/sda2 2099200 33554431 15727616 8e Linux LVM

/dev/sda3 33554432 209715199 88080384 8e Linux LVM

命令(输入 m 获取帮助):w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

正在同步磁盘。

[root@node01 html]# partprobe

[root@node01 html]# fdisk -l

磁盘 /dev/sda:107.4 GB, 107374182400 字节,209715200 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x000b41c1

设备 Boot Start End Blocks Id System

/dev/sda1 * 2048 2099199 1048576 83 Linux

/dev/sda2 2099200 33554431 15727616 8e Linux LVM

/dev/sda3 33554432 209715199 88080384 8e Linux LVM

磁盘 /dev/mapper/centos_centos7-root:14.4 GB, 14382268416 字节,28090368 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘 /dev/mapper/centos_centos7-swap:1719 MB, 1719664640 字节,3358720 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

[root@node01 html]# pvscan

PV /dev/sda2 VG centos_centos7 lvm2 [<15.00 GiB / 0 free]

Total: 1 [<15.00 GiB] / in use: 1 [<15.00 GiB] / in no VG: 0 [0 ]

[root@node01 html]# pvdisplay

--- Physical volume ---

PV Name /dev/sda2

VG Name centos_centos7

PV Size <15.00 GiB / not usable 3.00 MiB

Allocatable yes (but full)

PE Size 4.00 MiB

Total PE 3839

Free PE 0

Allocated PE 3839

PV UUID fnJGTj-hytV-Gdad-RuRN-95QG-kNzb-woGjOD

4. pvcreate新建物理卷

[root@node01 html]# pvcreate /dev/sda3

Physical volume "/dev/sda3" successfully created.

5. vgextend扩展卷组

[root@node01 html]# vgscan

Reading volume groups from cache.

Found volume group "centos_centos7" using metadata type lvm2

[root@node01 html]# vgextend centos_centos7 /dev/sda3

Volume group "centos_centos7" successfully extended

6. lvextend扩容逻辑卷

[root@node01 html]# lvscan

ACTIVE '/dev/centos_centos7/swap' [1.60 GiB] inherit

ACTIVE '/dev/centos_centos7/root' [13.39 GiB] inherit

[root@node01 html]# ls /dev/mapper/centos_centos7-

centos_centos7-root centos_centos7-swap

[root@node01 html]# ls /dev/mapper/centos_centos7-root

/dev/mapper/centos_centos7-root

[root@node01 html]# lvextend -l +100%FREE /dev/mapper/centos_centos7-root

Size of logical volume centos_centos7/root changed from 13.39 GiB (3429 extents) to 97.39 GiB (24932 extents).

Logical volume centos_centos7/root successfully resized.

7. xfs_growfs扩容文件系统

[root@node01 html]# df -hT

文件系统 类型 容量 已用 可用 已用% 挂载点

/dev/mapper/centos_centos7-root xfs 14G 12G 1.8G 88% /

devtmpfs devtmpfs 909M 0 909M 0% /dev

tmpfs tmpfs 920M 0 920M 0% /dev/shm

tmpfs tmpfs 920M 8.7M 912M 1% /run

tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup

/dev/sda1 xfs 1014M 143M 872M 15% /boot

tmpfs tmpfs 184M 0 184M 0% /run/user/0

tmpfs tmpfs 184M 0 184M 0% /run/user/1000

[root@node01 html]# xfs_growfs /dev/mapper/centos_centos7-root

meta-data=/dev/mapper/centos_centos7-root isize=512 agcount=4, agsize=877824 blks

= sectsz=512 attr=2, projid32bit=1

= crc=1 finobt=0 spinodes=0

data = bsize=4096 blocks=3511296, imaxpct=25

= sunit=0 swidth=0 blks

naming =version 2 bsize=4096 ascii-ci=0 ftype=1

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 3511296 to 25530368

8. 查看结果

[root@node01 html]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/centos_centos7-root 98G 12G 86G 12% /

devtmpfs 909M 0 909M 0% /dev

tmpfs 920M 0 920M 0% /dev/shm

tmpfs 920M 8.7M 912M 1% /run

tmpfs 920M 0 920M 0% /sys/fs/cgroup

/dev/sda1 1014M 143M 872M 15% /boot

tmpfs 184M 0 184M 0% /run/user/0

tmpfs 184M 0 184M 0% /run/user/1000

[root@node01 html]#

虚拟机服务器磁盘扩容步骤,vmware ESXi 虚拟机扩容磁盘空间相关推荐

  1. VMWARE ESXI虚拟机安装系统

    VMWARE ESXI虚拟机安装系统 上传系统 找到硬盘 打开数据储存浏览器 上传系统文件 创建虚拟机 右键虚拟机 创建虚拟机 类型 创建新虚拟机 选择名称和操作系统 命名(英文) 兼容性(默认) 客 ...

  2. 如何在ESXi5.1上运行一个虚拟的ESXi虚拟机并且在这个虚拟的ESXi虚拟机里运行64位的系统?...

    如何在ESXi5.1上运行一个虚拟的ESXi虚拟机并且在这个虚拟的ESXi虚拟机里运行64位的系统? 这个虚拟的ESXi虚拟机也叫作嵌入式ESXi,目前这个功能是一个体验版,仅用于测试或者教学演示用, ...

  3. 戴尔服务器虚拟机巨兽龙在哪,dell服务器安装的vmware esxi 虚拟机紫萍

    服务器型号:dell  R710服务器 DELL PowerEdge R710是DELL双路2U机架式服务器,支持最新的至强5600四核或六核处理器,最高支持192GB的DDR3内存(18插槽*16G ...

  4. 虚拟机测试服务器最大带宽,利用VMware ESXi测量网络延迟 你了解多少

    服务器应用必须与最终用户以及存储子系统交换数据,因此高效率的服务器虚拟化还必须包括稳固的网络性能.无效率的配置与网络延迟可能会和工作负载作对并损害用户体验.幸运的是,VMware ESXi提供了测量网 ...

  5. 虚拟机服务器如何关机命令行,安卓虚拟机如何关机命令行

    安卓虚拟机如何关机命令行 内容精选 换一换 华为鲲鹏云手机是运行在云端虚拟出带有原生安卓操作系统,具有虚拟手机功能的云服务器.免费云手机0元领取体验,可发放60台云手机实例!云手机业务数据提供云端数据 ...

  6. 虚拟机服务器需要多大内存吗,虚拟机服务器需要多大内存

    虚拟机服务器需要多大内存 内容精选 换一换 在性能优化时,需要遵循一定的原则,主要有以下几个方面:对性能进行分析时,要多方面分析系统的资源瓶颈所在,如CPU利用率达到100%时,也可能是内存容量限制, ...

  7. vm虚拟机服务器部署项目教程,Vmware 虚拟化项目实施步骤

    一.前期需求调查 网络拓扑 硬件:存储,服务器,光端机.交换机 软件:包括虚拟化软件,备份软件等 备份空间:本地磁盘大小和存储的大小(主要是lun的) 二.实施 1.存储的划分,服务器配置检查 2.部 ...

  8. 虚拟机服务器警报设置,设置VMware vCenter警报器获得更好的管理

    你可以利用VMware vCenter警报器来让自己警惕环境中各种各样的潜在问题.正确设置后,这些vCenter警报器能够缩短反应时间.预防故障或VM性能退化.在本文中,你将了解如何设置和管理vCen ...

  9. 服务器虚拟机装软路由,Esxi虚拟机安装Ros+Openwrt软路由双系统简单分享(踩到的坑,很大的坑)...

    近段时间ke学上网反应很慢,网上看到了 Ros+Openwr能够解决DNS污染的这个问题,所以看看自己的3825U小主机刚可以满足要求,搞一下吧. 听说L大的openwrt软路由固件ke学上网很不错, ...

最新文章

  1. ubuntu 下root用户无法访问声音设备的解决方案
  2. Ardino基础教程 21_LCD1602液晶屏
  3. 节点身份认证(1)DID(Decentralized Identity)系统
  4. 开博首发2017年1月13日开博大吉
  5. Android学习指南 第六讲:用户界面 View(二)
  6. 手机没电不用慌 荣耀门店推充电站服务为你解忧
  7. Java学习进阶—高级编程
  8. Junit运行报initializationError错误
  9. 京东6月18日正式登陆港交所 港股暗盘开涨超7%
  10. php 每天早上八点执行操作_php多进程单线程之phpcgi、phpfpm
  11. 全国计算机软考程序员考试大纲(2012)
  12. Mysql8.0如何重置密码
  13. C++搜索算法和曼哈顿距离之最少连通代价
  14. sql语句实现查询实例
  15. 线下活动受阻?打造线上会议方案势在必行
  16. 手机用久了耗电快?华为手机的后备隐藏能源,开启后续航强如新机
  17. c语言(cn)括号的作用,c语言小括号的用法
  18. GMSL部分问题解答/含官方FAE解答
  19. 靠一碗面一年三轮融资受资本热捧,张拉拉真的高枕无忧?
  20. 招商头条:上海将出新规促进跨国公司地区总部发展;第二十五届兰洽会落幕 共签约507个项目

热门文章

  1. 查看检测排名各网站的网站
  2. 无需下载,优质网站分享
  3. python爬取微博话题下面的帖子并存入excel文件
  4. ^v^^v^^v^联系我吧^v^^v^^v^
  5. 中班音乐活动计算机反思,中班音乐优质教案《计算器》含反思
  6. 微信公众号云服务器年服务费_微信公众号开发者接口费用高吗
  7. VMware虚拟机安装win10系统教程(巨细)
  8. CommandLineRunner和ApplicationRunner
  9. 福建农林大学计算机与信息学院副书记,福建农林大学计算机与信息学院导师介绍:钟一文...
  10. ATX 双电源切换电路