VMware ESXi 中的 CentOS 硬盘扩容
1. 在 vSphere Client 上直接扩大虚拟机的硬盘空间或者挂载一块新硬盘。
2. 查看当前硬盘空间情况:
[root@ucslab admin]# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/mapper/vg_ucslab-lv_root
50G 8.8G 38G 19% /
tmpfs 7.8G 88K 7.8G 1% /dev/shm
/dev/sda1 485M 30M 430M 7% /boot
/dev/mapper/vg_ucslab-lv_home
26G 616M 24G 3% /home
3. 创建新分区并调整分区类型:
[root@ucslab admin]# fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p (显示当前分区情况)
Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e362d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 10444 83373056 8e Linux LVM
Command (m for help): n (创建新的主分区)
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (10444-65270, default 10444):
Using default value 10444
Last cylinder, +cylinders or +size{K,M,G} (10444-65270, default 65270):
Using default value 65270
Command (m for help): p (显示当前分区情况)
Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e362d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 10444 83373056 8e Linux LVM
/dev/sda3 10444 65270 440395195 83 Linux
Command (m for help): t (修改分区类型为 Linux LVM, 8e)
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
Command (m for help): 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)
Syncing disks.
建议重启,或使用partprobe刷新硬盘情况。
4. 查看修改后的分区情况:
[root@ucslab admin]# fdisk -l
Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e362d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 10444 83373056 8e Linux LVM
/dev/sda3 10444 65270 440395195 8e Linux LVM
Disk /dev/dm-0: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 4227 MB, 4227858432 bytes
255 heads, 63 sectors/track, 514 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2: 27.5 GB, 27455913984 bytes
255 heads, 63 sectors/track, 3337 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/dm-2 doesn't contain a valid partition table
5. 初始化物理卷:
[root@ucslab admin]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created
6. 添加到卷组:
[root@ucslab admin]# lvm
lvm> vgdisplay
--- Volume group ---
VG Name vg_ucslab (卷组名称)
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 79.51 GiB
PE Size 4.00 MiB
Total PE 20354
Alloc PE / Size 20354 / 79.51 GiB
Free PE / Size 0 / 0
VG UUID 1xZKPs-dWqe-Y8Ca-x885-Czo7-wCA8-gMd5u2
lvm> vgextend /dev/vg_ucslab /dev/sda3
Volume group "vg_ucslab" successfully extended
lvm> vgdisplay
--- Volume group ---
VG Name vg_ucslab
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 499.50 GiB
PE Size 4.00 MiB
Total PE 127872
Alloc PE / Size 20354 / 79.51 GiB
Free PE / Size 107518 / 419.99 GiB
VG UUID 1xZKPs-dWqe-Y8Ca-x885-Czo7-wCA8-gMd5u2
7. 显示逻辑卷情况,并扩展逻辑卷大小,每个逻辑卷扩展200G:
lvm> lvdisplay
--- Logical volume ---
LV Name /dev/vg_ucslab/lv_root
VG Name vg_ucslab
LV UUID ekSWAJ-Yv5j-E9br-nmyF-jNtV-PXGb-LpxdDt
LV Write Access read/write
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/vg_ucslab/lv_home
VG Name vg_ucslab
LV UUID cNeSMR-eddd-noQx-nMpq-pf1i-g3Qu-DEEt2M
LV Write Access read/write
LV Status available
# open 1
LV Size 25.57 GiB
Current LE 6546
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Name /dev/vg_ucslab/lv_swap
VG Name vg_ucslab
LV UUID DxN0XW-2g7D-ffle-zYme-yH4O-Ntbv-llAxPY
LV Write Access read/write
LV Status available
# open 1
LV Size 3.94 GiB
Current LE 1008
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
lvm> lvextend -L +200G /dev/vg_ucslab/lv_root
Extending logical volume lv_root to 250.00 GiB
Logical volume lv_root successfully resized
lvm> lvextend -L +200G /dev/vg_ucslab/lv_home
Extending logical volume lv_home to 225.57 GiB
Logical volume lv_home successfully resized
lvm> quit
Exiting.
xfs_growfs /dev/centos/root df -h
转载于:https://blog.51cto.com/littlebamboo/1931331
VMware ESXi 中的 CentOS 硬盘扩容相关推荐
- 在VMware ESXi中使用固态硬盘
公司一台数据库的虚拟机对IO要求高,现在添加一块SSD卡供其使用,宿主机是esxi5.5,虚拟机是windows 2008 r2,服务器是dell R620 由于没有驱动装上SSD卡后在esxi存储里 ...
- 服务器的固态硬盘使用raid非ssd,在VMware ESXi中使用固态硬盘的注意事项
为了提高虚拟机的性能,在现在配置VMware ESXi时,一般需要在主机上添加一块到多块固态硬盘,作为缓存使用.通常情况下,为主机配置1块120G-240GB的固态硬盘即可.在使用固态硬盘时,不要使用 ...
- VMWare ESXi系统中给虚拟机硬盘扩容记录(CentOS7)
文章目录 背景 操作步骤 1.在VMWare ESXi中给虚拟机扩容 2.进入虚拟机查看系统分区情况(检查容量是否增加) 3.新建分区 4.格式化新建的分区 5.合并分区 6.再次确认 问题处理 背景 ...
- [转载]在Vmware ESXI中安装群晖Synology DSM 5.0 (4528)
转载 在Vmware ESXI中安装群晖Synology DSM 5.0 (4528) 文件准备 Vmware ESXi用户安装需要的文件 NB_x64_5032_DSM_50-4528_Xpenol ...
- esxi远程管理端口_如何在 vmware esxi 中开放 VNC功能及端口实现远程管理 完整篇...
VMWare esxi中开放 VNC功能及端口实现远程管理 完整篇 在多个论坛上看了相关文章,总的写得不完整.现将各方资源整编写完整版.详文如下! 步骤1. 修改ESXi主机的firewall配置 在 ...
- esxi远程管理端口_如何在 vmware esxi 中开放 VNC功能及端口实现远程管理 完整篇...
VMWare esxi中开放 VNC功能及端口实现远程管理 完整篇 在多个论坛上看了相关文章,总的写得不完整.现将各方资源整编写完整版.详文如下! 步骤1. 修改ESXi主机的firewall配置 在 ...
- 在VMware虚拟机中安装CentOS 7
背景: 阅读新闻 [日期:2015-09-22] 来源:Linux社区 作者:Linux [字体:大 中 小] [正文] 一. VMware简介: VMware是一个虚拟PC的软件,可以在现有的操纵系 ...
- 用LVM在VMware中的Linux硬盘扩容
2019独角兽企业重金招聘Python工程师标准>>> 步骤总结一下就是,"使用VMWare扩展硬盘空间->Linux下分区.格式化->LVM卷管理->使 ...
- 增加ESXI中虚拟机CENTOS系统分区容量
一.使用虚拟机安装的centos 6.2 x64,分区时把u01分小了,在原硬盘的基本上增加50G,可重启后需要调整分区容量. 原分区如下: [oracle@oracleone ~]$ df -h ...
最新文章
- Altium Designer旋转PCB、PCB中绕某点旋转
- 安装centos6.0 未找到任何驱动器
- 转,jquery中attr和prop的区别
- 【Linux网络编程学习】阻塞、非阻塞、同步、异步以及五种I/O模型
- ssh解决root_unlock_time问题
- 开源硬件_如何参与开源硬件协会
- python: os.walk() 相关操作
- Android移动应用基础教程【服务】
- 《最后的风之子/神风终极战士》1024*576分辨率 BD中英双字无水印
- ping tracert 用法
- linux nginx rtmp 直播,nginx+rtmp简单直播
- 李治军操作系统 笔记
- 【工具推荐】在线latex公式编辑器(可用鼠标交互)
- 联想服务器系统如何备份软件,联想笔记本如何使用系统自带备份/还原功能进行备份与还原系统...
- Python小白的数学建模课-21.关键路径法
- 基于Simulink的开关电源仿真设计
- 项目实战 |根据找到的variants的结果生成突变矩阵
- 对软件项目外包的一些认识
- RabbitMQ宕机后,消息100%不会丢失吗
- JavaScript 播放多条音频与延迟播放
热门文章
- 【视频】使用VLC采集摄像头,以RTSP协议发送流到网络上
- 【视频】V4L2之应用流程
- android 官方默认动画,Android动画一:Activity过渡动画详细实现原理
- matlab 数据集制作,机器学习数据集制作与划分MATLAB实现
- android标题栏添加按钮_改善Android布局性能
- java wait abc_java----wait/notify
- vue html引入资源dev下404,webpack vue 项目打包生成的文件,资源文件报404问题的修复方法(总结篇)...
- java打包_java工程打包(方式一)
- c语言最小费用流_策略算法工程师之路-图优化算法(一)(二分图amp;最小费用最大流)...
- JDK11使用IDEA,配置JavaFX