Quote:
Originally Posted by MikeyCarter
1. Is there an automatic defrag for lvm so I can put logical volumes together on the various disks?
|
no
defrag but you can use
man 8 pvmove to move the LV's or LVs' PEs from a PV or PVs to a different PV
in it's simplest form
pvmove --background /dev/sda2 /dev/sdb3 will move all allocated PEs from sda2|PV to sdb3|PV as long as sdb3|PV has enough free PEs to accomodate.
(NOTE: I've always started the pvmove with --background and then checked status with a separate pvmove process with --interval and, while i do not perform this often, the 6-8 times initiated has completed successfully for me. YMMV)
Quote:
Originally Posted by MikeyCarter
2. Is there a way to move entire logical volume to a new disk rather than having to do it individually over the ~20 pv's that it's sitting on?
|
yes,
man 8 pvmove.
given, PVs sdc1, sdc5, sdd2, sdd3, sde6 contain all of PEs for LV named MikeyCarter and sdg8 has enough PEs available to entirely contain MikeyCarter LV one should (may need to check syntax|structure here...) be able to run the following
(or similar):
Code:
pvmove --background --name MikeyCarter /dev/sdc1 /dev/sdc5 /dev/sdd2 /dev/sdd3 /dev/sde6 /dev/sdg8
if you just want to vacate a PV of all allocated PEs and let LVM move it to available PVs within the VG:
Code:
pvmove --background /dev/sdh1