User Tools

Site Tools


extending_a_logical_volume_in_vmware_machine

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
extending_a_logical_volume_in_vmware_machine [2017/11/20 20:28] lucyextending_a_logical_volume_in_vmware_machine [2021/12/20 12:29] (current) lucysecurity
Line 1: Line 1:
 +===== Extending a logical volume in VMware machine =====
 +
 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 Lucy. A more complete guide with screenshots can be found {{ ::guide.pdf |here}}. 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 Lucy. A more complete guide with screenshots can be found {{ ::guide.pdf |here}}.
  
-Caution: We recommend to take a complete backup of the virtual machine prior to making these changes.+**Caution: We recommend taking a complete backup of the virtual machine prior to making these changes.**
  
 1. Power off the virtual machine.\\ 1. Power off the virtual machine.\\
-2. Edit the virtual machine settings and extend the virtual disk size. \\ +2. Edit the virtual machine settings and extend the virtual disk size.\\ 
-For more information, see Increasing the size of a virtual disk (1004047).\\+{{ :wmvare_01.png?400 |}} 
 +\\ 
 +For more information, see [[https://kb.vmware.com/s/article/1004047?r=2&KM_Utility.getArticleLanguage=2&KM_Utility.getArticle=1&KM_Utility.getGUser=1&KM_Utility.getArticleData=1&Quarterback.validateRoute=1|Increasing the size of a virtual disk (1004047)]].\\ 
 3. Power on the virtual machine.\\ 3. Power on the virtual machine.\\
 4. Print the partition table to verify the number of partitions by running the command:\\ 4. Print the partition table to verify the number of partitions by running the command:\\
-# fdisk -l\\+''# fdisk -l''\\ 
 By default, there are 3:  sda1, sda2 and sda5.\\ By default, there are 3:  sda1, sda2 and sda5.\\
-4. Create a new primary partition - sda3:\\ +{{ :wmvare_04.png?400 |}} 
-a) Run the command:\\ +\\ 
-# fdisk /dev/sda\\ +5. Create a new primary partition - sda3:\\ 
-b) Press <n> to create a new primary partition.\\ +  Run the command:\\ 
-c) Press <p> for primary.\\ +''# fdisk /dev/sda''\\ 
-d) Press <3> for the partition number.\\ +  Press **<n>** to create a new primary partition.\\ 
-e) Press <Enter> two times.\\ +  Press **<p>** for primary.\\ 
-f) Press <t> to change the system's partition ID.\\ +  Press **<3>** for the partition number.\\ 
-g) Press <3> to select the newly creation partition.\\ +  Press **<Enter>** two times.\\ 
-h) Type 8e to change the Hex Code of the partition for Linux LVM.\\ +  Press **<t>** to change the system's partition ID.\\ 
-i) Press <w> to write the changes to the partition table.\\ +  Press **<3>** to select the newly creation partition.\\ 
-5. Restart the virtual machine:\\ +  Type **8e** to change the Hex Code of the partition for Linux LVM.\\ 
-# shutdown -r now\\+  Press **<w>** to write the changes to the partition table.\\ 
 +6. Restart the virtual machine:\\ 
 +''# shutdown -r now''\\ 
 +\\
 7. Verify whether sda3 has successfully created, by running the command:\\ 7. Verify whether sda3 has successfully created, by running the command:\\
-# fdisk -l\\+''# fdisk -l''\\ 
 +{{ :wmvare_07.png?400 |}}
 8. Create another primary partition sda4:\\ 8. Create another primary partition sda4:\\
-a) Run the command:\\ +  * Run the command:\\ 
-# fdisk /dev/sda\\ +''# fdisk /dev/sda''\\ 
-b) Press <n> to create a new primary partition.\\ +  Press <n> to create a new primary partition.\\ 
-c) Press <p> for primary.\\ +  Press <p> for primary.\\ 
-Note. The number of partition <4> was selected automatically.\\ +**Note.** The number of partition **<4>** was selected automatically.\\ 
-d) Press <Enter> two times.\\ +  Press <Enter> two times.\\ 
-e) Press <t> to change the system's partition ID.\\ +  Press <t> to change the system's partition ID.\\ 
-f) Press <4> to select the newly creation partition.\\ +  Press <4> to select the newly creation partition.\\ 
-g) Type 8e to change the Hex Code of the partition for Linux LVM.\\ +  Type 8e to change the Hex Code of the partition for Linux LVM.\\ 
-h) Press <w> to write the changes to the partition table.\\+  Press <w> to write the changes to the partition table.\\
 9. Restart the virtual machine once again:\\ 9. Restart the virtual machine once again:\\
-# shutdown -r now\\+''# shutdown -r now''\\ 
 +\\
 10. Verify whether sda4 has successfully created, by running the command:\\ 10. Verify whether sda4 has successfully created, by running the command:\\
-# fdisk -l\\+''# fdisk -l''\\ 
 +{{ :wmvare_10.png?400 |}}
 11. Run this command to convert the new partition to a physical volume:\\ 11. Run this command to convert the new partition to a physical volume:\\
-# pvcreate /dev/sda4\\+''# pvcreate /dev/sda4''\\ 
 +\\
 12. Run this command to extend the physical volume:\\ 12. Run this command to extend the physical volume:\\
-# vgextend phishing /dev/sda4\\+''# vgextend phishing--vg /dev/sda4''\\ 
 +\\
 13. Run this command to verify how many physical extents are available to the Volume Group:\\ 13. Run this command to verify how many physical extents are available to the Volume Group:\\
-# vgdisplay phishing | grep "Free"\\+''# vgdisplay phishing--vg | grep "Free"''\\ 
 +\\
 14. Run the following command to extend the Logical Volume:\\ 14. Run the following command to extend the Logical Volume:\\
-# lvextend -L+#G /dev/phishing/root\\ +''# lvextend -L+#G /dev/phishing-vg/root''\\ 
-Where <#> is the number of Free space in GB available as per the previous command. Use the full number output from Step 13 including any decimals.\\+\\ 
 +Where **<#>** is the number of Free space in GB available as per the previous command. Use the full number output from Step 13 including any decimals.\\ 
 +\\
 15. Run the following command to expand the ext3 filesystem online, inside of the Logical Volume:\\ 15. Run the following command to expand the ext3 filesystem online, inside of the Logical Volume:\\
-# resize2fs /dev/phishing/root\\+''# resize2fs /dev/phishing-vg/root''\\ 
 +\\
 16. Run the following command to verify that the / filesystem has the new space available:\\ 16. Run the following command to verify that the / filesystem has the new space available:\\
-# df -h\\ +''# df -h''\\ 
- +{{ :wmvare_16.png?400 |}}
extending_a_logical_volume_in_vmware_machine.1511206120.txt.gz · Last modified: 2019/07/25 12:51 (external edit)