How to add a virtual disk without restarting vmwarevm
Recently, because the business needs to resize the system without restarting the system, the premise is that the system has been lvm, but there is not enough physical volume (hard disk), so a new article is introduced, this article is divided into two parts: the first part.
Directory
- Add Disk
- LVM
Add Hard Disk
In order to add disks to a virtual machine without restarting the virtual machine, this experiment was conducted today.
Edit the vm parameters on the vSphere management interface, as shown in.
Command: echo "--">/sys/class/scsi_host/host0/scan
You can identify the newly added Virtual Disk without restarting the system, as the newly added hard disk is 10 Gb, as shown in:
LVM
Run the cfdisk command to format and mount the disk:
(1) format the hard disk: cfdisk-> new-> Primary-> Type-> 8e (the reason is to do LVM)-> write-> quit
The fdisk-l command shows the Newly Added Disk Partition:
(2) Add to LVM:
A. pvcreate/dev/sdb1
B. vgextend VolGroup/dev/sdb1
C. lvextend-L + 10G/dev/VolGroup/lv_root
D. resize2fs/dev/VolGroup/lv_root
The original root directory is only 36 GB. Now, check df-h again. It can be seen that it has increased by nearly 10 Gb.
This article permanently updates the link address: