Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


kvm_shrink_nested_lvm

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
Next revisionBoth sides next revision
kvm_shrink_nested_lvm [2014/06/11 15:33] – [KVM shrink nested LVM] adminkvm_shrink_nested_lvm [2014/06/11 15:52] – [KVM shrink nested LVM] admin
Line 10: Line 10:
   * If you need to reduce the rootfs, boot from network, usb or cd/dvd. Then resize the filesystem. For example, edit guest to boot from systemrescuecd. <code>   * If you need to reduce the rootfs, boot from network, usb or cd/dvd. Then resize the filesystem. For example, edit guest to boot from systemrescuecd. <code>
 lvresize -r -L8G /dev/VolGroup/lv_root</code> lvresize -r -L8G /dev/VolGroup/lv_root</code>
-  * Shrink physical volume. <code>+  * Shrink physical volume. First move LV's to beginning.<code>
 pvdisplay -m pvdisplay -m
 pvmove -v /dev/vda2:2296-2551 /dev/vda2:0-255 --alloc anywhere pvmove -v /dev/vda2:2296-2551 /dev/vda2:0-255 --alloc anywhere
 pvmove -v /dev/vda2:2552-2799 /dev/vda2:256-503 --alloc anywhere pvmove -v /dev/vda2:2552-2799 /dev/vda2:256-503 --alloc anywhere
- +pvmove -v /dev/vda2:10428-12475 /dev/vda2:504-2551 --alloc anywhere
 pvresize -v --setphysicalvolumesize 16G /dev/vda2</code> pvresize -v --setphysicalvolumesize 16G /dev/vda2</code>
 +  * On the KVM host, reduce the LV. <code>lvresize -L16G /dev/vg_kvm1/vmns2</code>
  
  
kvm_shrink_nested_lvm.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1