VMware expands the hard disk and modifies the Linux logical volume size

Source: Internet
Author: User

I. background

As the business continues to mature, more and more data is accumulated in the database. A few days ago, I found that the server's disk was about to be full. Therefore, apply to the virtualization administrator to increase disk space.

Because the system is built on the vSphere platform of VUI, the virtualization administrator simply expands the disk space through the VMware vSphere Client, and the remaining work is mine.

II. Environment

The system environment is RHEL6.3. To ensure scalability, LVM is used for the root directory/at the initial stage of implementation. In addition, in order to minimize the unavailable time, the system is always running when the virtual hard disk space is expanded.

Iii. Process

After the virtualization administrator expanded the disk, I found that the system did not immediately identify the disk size change. I have executed partprobe several times and it does not work. Therefore, the server is restarted first.

After the restart is completed, fdisk-l is used to identify the disk as a new capacity.

At this point, adjust the disk according to the LVM method.

Because the new hard disk is recognized as unpartitioned space in the system, fdisk is used to partition the disk first.

Fdisk/dev/sda

The prompt is "n" (create a new partition), select the partition type and serial number, enter the start position and size.

Then, press w to exit and save the changes to the partition. At this time, the system cannot identify the newly added partition. To execute

Partx-a/dev/sda

Make the partition take effect. If an error is reported, it is recommended that you restart the system.

Create a new partition as a physical volume (PV)

1 pvcreate/dev/sda5

Then add the physical volume to the volume group (VG ).

Vgextend vg_rhel/dev/sda5

In this case, you can use vgdisplay to view the status of the volume group.

Now we can adjust the logical volume size

Lvextend-L + 20G/dev/vg_rhel/lv_root

After that, the file system cannot identify the new size. You need to adjust the file size.

Resize2fs/dev/vg_rhel/lv_root

Since the Oracle database is used online, after completing the above steps, you need to start Oracle

Sqlplus/as sysdba

Execute startup at the Oracle prompt

After the prompt is successful, exit sqlplus and start the listening service

Lsnrctl start

The entire process ends.

Recommended reading:

Install VMtools in openfilter Linux

Install VMware Workstation 9.0 Virtual Machine in Windows 7

Download the official version of VMware Workstation 9.0 (with the registration machine + Serial Number activation code ):

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.