Some time ago with VMware VSphere Client management of several virtual machines, due to the need to set up the PTF server, the capacity of the hard disk is obviously not enough to expand, access to a portion of the data, it is difficult to find in an article a complete
Solution, please tidy up.
System: CENTOS7
Management software: VMware vSphere Client
The first step: virtual machine power off, virtual machines to the physical expansion.
Before expansion:
Physical expansion of power to 150g
It is not actively mounted to the system when power is restarted. Not actively mounted.
2. Start the feast.
Physically already exists and begins operation.
3.
Command FDISK/DEV/SDA
n Create a new partition
P because it is Linux with LVM management disk, select p otherwise choose E
3 default
Enter default
Enter default
After execution, p view the execution results
Not yet converted to LVM format, continue operation
Command T convert disk
3
8e conversion to LVM
P View Effects, W save.
Execution complete
End the first paragraph of work, reboot the machine.
4. Start creating partitions
First look at the disk condition
View the disk to add the expanded disk to the appropriate disk volume, depending on the situation
View remaining disk space headroom: Vgdisplay CentOS remaining 70.6 space
Adding new disk space to the CentOS logical volume
Lvextend-l +70g/dev/centos/root
5. The final step
Xfs_growfs/dev/mapper/centos-root
You can not use RESIZE2FS or error
Resize2fs:bad magic number in Super-block cannot find a valid file system Super block when attempting to open/dev/centos/root.
Perform
Parted
Command: