云主机centos硬盘扩容
一、增加虚拟机空间配置
1.删除虚拟机系统快照,有快照的虚拟机是不能调整磁盘大小的。
2.在hyperv 主机下,选中虚拟机,右键编辑设置,打开虚拟机属性设置,调整磁盘大小。
3.重新启动虚拟机,进入查看新的硬盘情况:fdisk -l
二、调整虚拟机磁盘LVM
1.查看现有的硬盘分区(现在空间没有变大)
#df -h
2.对新增的硬盘空间做新增分区(硬盘数没有增加,增加的是空间)
#fdisk /dev/sda
The number of cylinders for this disk is set to 7832.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n 说明:新增分区
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3 说明:新增分区号(1,2默认已经用了)
First cylinder (2611-7832, default 2611): 默认回车(最小)
Using default value 2611
Last cylinder or +size or +sizeM or +sizeK (2611-7832, default 7832):默认回车(最大)
Using default value 7832
Command (m for help): t 说明:修改分区类型
Partition number (1-4): 3 说明:修改分区类型对应的分区号
Hex code (type L to list codes): 8e 说明:8e是lvm磁盘类型
Changed system type of partition 3 to 8e (Linux LVM)
Command (m for help): p 说明:打印分区表
Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14