Linux:CentOS 6.0
ESXi:6.7
原硬盘空间为40G,在VM上增加10G空间到50G,如下硬盘扩容操作过程。
#扩容前查看硬盘使用空间为39G,已使用100%.
[root@EZ cacti]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_cactiezv10-LogVol00
39G 39G 0 100% /
tmpfs 1004M 0 1004M 0% /dev/shm
/dev/sda1 194M 25M 160M 14% /boot
#ESXi中增加硬盘空间后,如下操作。
1,查看当前待扩容硬盘状态。
[root@EZ ~]# fdisk -l
Disk /dev/sda: 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: 0x00089c87
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 5222 41737216 8e Linux LVM
Disk /dev/dm-0: 41.7 GB, 41662021632 bytes
255 heads, 63 sectors/track, 5065 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: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 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
2,进行分区操作。
[root@EZ ~]# 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): n (新建分区)
Command action
e extended
p primary partition (1-4)
p (主分区)
Partition number (1-4): 3 (选择默认或指定分区号,默认起始位置和结束位置(全盘))
First cylinder (5222-6527, default 5222):
Using default value 5222
Last cylinder, +cylinders or +size{K,M,