====== Linux Volume Management ====== LVM is a highly flexible abstraction layer for hard disks, or the like. It sits somewhere in between the physical storage device and the filesystem, but other layers like e.g. [[system:filesystem:raid:soft|dm-raid]] or loop-devices may exist below or above it. ===== Moving a Volume Group between Physical Volumes ===== - Optionally add a physical volume: ''vgextend '' - Move extends away from a physical volume: ''pvmove '' - Remove physical volume from volume group: ''vgreduce '' ===== Moving Logical Volumes between Volume Groups ===== This works by merging the two volume groups temporarily, so the destination volume group must be unused during the process. Since the meaning of ''source'' and ''target'' differs in the commands involved, the later assumes ''srcvg'' being the volume group containing volumes to move away and ''dstvg'' being the volume group to move to. - Merge ''dstvg'' into ''srcvg'': ''vgmerge '' - Move a volume to a physical volume on ''dstvg'': ''pvmove -n '' - Optionally repeat last step with all other volumes to move - Unmount all moved volumes - Make moved volumes inactive: ''lvchange -an '' - Split off ''dstpv'' from ''srcvg'': ''vgsplit '' - Make moved volumes active again: ''vgchange -ay '' - Change mount paths in ''/etc/fstab'' and finally mount them again ===== Show on which Physical Volumes a Logical Volume resides ===== Just use the ''-m'' flag to ''lvdisplay''.