Do not restart vmwarevm to add Virtual Disks (on), vmware Virtual Disks
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 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.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.