Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Extending a logical volume in a virtual machine running Red Hat or Cent OS (1006371)

Last Updated: 6/10/2021Categories: How toTotal Views: 166127Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

238 like this article

Subscribe to get an email
newsletter with new updates

238 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Purpose

This article provides steps for extending the root partition residing in a logical volume created with Logical Volume Manager (LVM) in a virtual machine running Red Hat/Cent OS.

Resolution

After you increase the VM's hard disk size from Edit Settings, you must present this change to the internal Guest OS by following the below steps.

To extend the logical volume:

Caution: VMware recommends to take a complete backup of the virtual machine prior to making these changes.

Power off the virtual machine.

Edit the virtual machine settings and extend the virtual disk size. For more information, see Increasing the size of a virtual disk (1004047).

Power on the virtual machine.

Identify the device name, which is by default /dev/sda, and confirm the new size by running the command:

# fdisk -l

Create a new primary partition:

Run the command:

# fdisk /dev/sda (depending the results of the step 4)

Press p to print the partition table to identify the number of partitions. By default, there are 2: sda1 and sda2.

Press n to create a new primary partition.

Press p for primary.

Press 3 for the partition number, depending on the output of the partition table print.

Press Enter two times.

Press t to change the system's partition ID.

Press 3 to select the newly creation partition.

Type 8e to change the Hex Code of the partition for Linux LVM.

Press w to write the changes to the partition table.

Restart the virtual machine.

Run this command to verify that the changes were saved to the partition table and that the new partition has an 8e type:

# fdisk -l

Run this command to convert the new partition to a physical volume:

Note: The number for the sda can change depending on system setup. Use the sda number that was created in step 5.

# pvcreate /dev/sda3

Run this command to extend the physical volume:

Note: To determine which volume group to extend, use the command vgdisplay.

Note: Additionally, for the remainder of the commands, VolGroup00 will be unique to each Guest and should be adjusted to reflect your specific VM.

# vgextend VolGroup00 /dev/sda3

Run this command to verify how many physical extents are available to the Volume Group:

# vgdisplay VolGroup00 | grep "Free"

Run the following command to extend the Logical Volume:

Note: To determine which logical volume to extend, use the command lvdisplay.

# lvextend -L+#G /dev/VolGroup00/LogVol00

Where # is the number of Free space in GB available as per the previous command. Use the full number output from Step 10 including any decimals.

Run the following command to expand the ext3 filesystem online, inside of the Logical Volume:

Note:

Use resize2fs instead of ext2online for non-Red Hat virtual machines.

Use xfs_growfs for Red Hat, CentOS 7 and other VM Guest OS types that use the XFS file system.

# ext2online /dev/VolGroup00/LogVol00

Run the following command to verify that the / filesystem has the new space available:

# df -h /

Note: Defer to Red Hat or Cent OS for maximum size for logical volumes based on OS versions.

Related Information

For more information, see The Linux Logical Volume Manager from Redhat.

Note: The preceding link was correct as of January 29, 2014. If you find the link is broken, please provide feedback and a VMware employee will update the link.

Note: If the extended vmdk does not reflect the new size under Linux guest OS, rescan SCSI device using the following command:

echo 1 > /sys/block/$DEVICE/device/rescan where $DEVICE is 'sda'

For example:

echo 1 > /sys/block/sda/device/rescan

Increasing the size of a virtual disk
Como estender um volume lógico em uma máquina virtual executando o Red Hat ou Cent OS
Extensión de un volumen lógico en una máquina virtual con Red Hat o SO Cent
在运行 Red Hat 或 Cent OS 的虚拟机中扩展逻辑卷
Red Hat または Cent OS を実行している仮想マシン内の論理ボリュームの拡張

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-2 of 2

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant