Differenze tra le versioni di "Extend a Volume Group"

Da WikiSitech.
Vai alla navigazioneVai alla ricerca
(Creata pagina con "Extending a logical volume in a virtual machine running Red Hat, Cent OS or OpenSUSe '''Purpose'''<br> This article provides steps for extending a volume group created with L...")
 
Riga 5: Riga 5:
 
<br>
 
<br>
 
'''Resolution'''<br>
 
'''Resolution'''<br>
Create a new disk<br>
+
Create a new disk then [[Rescan_added_HDD_since_last_boot|rescan devices]].<br>
 
<br>
 
<br>
 
Run this command to convert the new disk to a physical volume:
 
Run this command to convert the new disk to a physical volume:

Versione delle 15:51, 30 ott 2017

Extending a logical volume in a virtual machine running Red Hat, Cent OS or OpenSUSe

Purpose
This article provides steps for extending a volume group created with Logical Volume Manager (LVM) in a virtual machine running Red Hat/Cent OS/OpenSUSe.
Resolution
Create a new disk then rescan devices.

Run this command to convert the new disk 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:

# vgextend VolGroup00 /dev/sda3

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

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:

# 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. Or use:

# lvextend -l +100%FREE /dev/VolGroup00/LogVol00

to extend to max size available.

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

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

# resize2fs /dev/VolGroup00/LogVol00

Note: Use ext2online instead of resize2fs if it is a Red Hat virtual machine.

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

# df -h /