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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:os_install_vm_template [2016/09/28 22:05]
billdozor [Add/Expand Storage]
linux_wiki:os_install_vm_template [2019/05/25 23:50] (current)
Line 254: Line 254:
   * Create a VM Template from the powered off system.   * Create a VM Template from the powered off system.
-====== Add/Expand Storage ====== 
-After deploying a VM from the template, you may need to expand storage on one of the partitions. 
-  - Add an additional hard disk to the VM. (Either from initial deployment or hot add to the VM) 
-  - Verify disk device name to use:<code bash>fdisk -l</code> 
-  - Create a new partition on the disk and format it as a ā€œ8eā€ (Linux LVM) type 
-    - fdisk /dev/sdb 
-      - Command: n 
-      - Command action (primary partition): p 
-      - Partition number: 1 
-      - First cylinder: enter for default of the first 
-      - Last cylinder: enter for default of the last 
-      - Command: t 
-      - Selected partition 1 (message displayed when only 1 partition exists) 
-      - Hex code: 8e (for LVM) 
-      - Command: w 
-  - Create a LVM physical disk from the partition<code bash>pvcreate /dev/sdb1</code> 
-  - Add the new physical disk to the existing volume group<code bash>vgextend vglocal /dev/sdb1</code> 
-  - Extend the logical volume that needs the space (/home will be used in this example) 
-    - **Option 1 (Preferred)**: Move the physical extents of the logical volume to the new disk, so all of it resides on the same VMDK, and then use all of that new disk's space. 
-      * This method is preferred because there is a performance hit when a partition spans VMDKs<code bash>pvmove --name lvhome /dev/sda2 /dev/sdb1 
-lvextend --resizefs /dev/mapper/vglocal-lvhome /dev/sdb1</code> 
-    - Option 2: Give the logical volume all of the space from the newly added physical volume<code bash>lvextend --resizefs --extents +100%PVS /dev/mapper/vglocal-lvhome /dev/sdb1</code> 
-    - Option 3: Give the logical volume a specific amount of additional free space from a specific physical volume<code bash>lvextend --resizefs --size +10G /dev/mapper/vglocal-lvhome /dev/sdb1</code> 
-    - Option 4: Give the logical volume all of the free space available to the volume group (potentially across multiple physical disks)<code bash>lvextend --resizefs --extents +100%FREE /dev/mapper/vglocal-lvhome</code> 
-  - Verify LVM Allocation 
-    - Logical Volume: <code bash>lvs</code> 
-    - Volume Group: <code bash>vgs</code> 
-    - Physical Volumes: <code bash>pvs</code> 
-  - Grow the file system (Not required if you used "--resizefs" during lvextend) 
-    - Ext2/3/4<code bash>resize2fs /dev/mapper/vglocal-lvhome</code> 
-    - XFS<code bash>xfs_growfs /dev/mapper/vglocal-lvhome</code> 
-  - Verify filesystem space<code bash>df -h</code> 
 ---- ----
  • linux_wiki/os_install_vm_template.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)