How to add a virtual disk without restarting vmwarevm

Source: Internet
Author: User

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

  1. Add Disk
  2. 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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.