Difference between revisions of "Extend LVM on qcow2 images"

From wikieduonline
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
* Follow https://www.technomenace.com/2014/08/how-to-extend-lvm-on-qcow2-images/
+
== Process ==
 +
* <code>[[qemu-img resize]]</code> -> <code>[[virt-resize]]</code> -> <code>[[lvextend|lvextend --resizefs]]</code>
  
 +
== Examples ==
 +
* Example using <code>[[virt-resize]]</code>: https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/
 +
* https://www.technomenace.com/2014/08/how-to-extend-lvm-on-qcow2-images/
  
 
+
== Commands ==
* <code>[[qemu-img]] resize c845ba080f2326a51c53965af1ac6c18 +3G</code>
+
* <code>[[qemu-img]] [[qemu-img resize|resize]] c845ba080f2326a51c53965af1ac6c18 +3G</code>
 +
* <code>[[qemu-img info]]</code>
 
* Modify partition with: <code>fdisk /dev/vdX</code> + Reboot
 
* Modify partition with: <code>fdisk /dev/vdX</code> + Reboot
 
* <code>[[pvresize]] /dev/vdX#</code> (Expand a PV after enlarging the partition)
 
* <code>[[pvresize]] /dev/vdX#</code> (Expand a PV after enlarging the partition)
Line 9: Line 14:
 
* <code>[[resize2fs]] /dev/mapper/VolGroup-lv_root</code>
 
* <code>[[resize2fs]] /dev/mapper/VolGroup-lv_root</code>
  
 +
 +
== Activities ==
 +
* Read about raw files and [[qcow2]] differences: https://www.berrange.com/posts/2017/02/10/the-surprisingly-complicated-world-of-disk-image-sizes/
 +
 +
== Related ==
 +
* [[Kubernetes PVC resize: kubectl patch pvc]]
 +
* [[Increase EBS size]]
  
 
== See also ==
 
== See also ==
* Read about raw files and [[qcow2]] differences: https://www.berrange.com/posts/2017/02/10/the-surprisingly-complicated-world-of-disk-image-sizes/
+
* {{qemu-img}}
* [[wwikipedia:Qcow|Qcow]] file format
+
* [[wikipedia:Qcow|Qcow]] file format
 +
* {{KVM}}
 
* <code>[[virt-resize]]</code>
 
* <code>[[virt-resize]]</code>
 +
* {{LVM}}
  
 
[[Category:Linux]]
 
[[Category:Linux]]
 +
[[Category:Virtualization]]

Latest revision as of 15:31, 14 April 2023

Process[edit]

Examples[edit]

Commands[edit]

  • qemu-img resize c845ba080f2326a51c53965af1ac6c18 +3G
  • qemu-img info
  • Modify partition with: fdisk /dev/vdX + Reboot
  • pvresize /dev/vdX# (Expand a PV after enlarging the partition)
  • lvextend -L +1.8G /dev/mapper/VolGroup-lv_root
  • resize2fs /dev/mapper/VolGroup-lv_root


Activities[edit]

Related[edit]

See also[edit]

scan: pvscan vgscan
LVM: lvs lvmscan lvm fullreport lvmreport lvmconfig lvmdump lvmcheck lvm dumpconfig
Scan: pvs vgs lvs pvscan vgscan
PV: pvcreate pvremove pvscan pvremove pvscan pvs pvchange pvck pvdisplay pvresize
LV: lvdisplay lvcreate lvremove, lvresize, lvextend, lvreduce, lvrename
VG: vgdisplay,vgcreate,vgremove, vgextend, vgreduce, vgscan, vgchange, vgrename, vgcfgbackup, vgcfgrestore, vgimportclone, vgck
Check commands: pvck vgck

Advertising: