====== LVM ====== ''df -h'' shows filesystem information Also helpful: system-config-lvm ((http://www.bross.eu/2007/11/26/how-to-install-lvm-gui-in-ubuntu/)) Remember to look for e.g. samba shares of regarding drives before changing the partition layout. I had a share pointing to a windows drive, which will be vaporized. ===== Commands Overview ===== | ^ LVM commands ^ Szenario A ((#adding_free_disk_space_to_lvm)) ^ ^ Information |''pvscan'' / ''pvs'' | | | |''pvdisplay'' | | | |''vgscan'' / ''vgs'' | | | |''vgdisplay'' | | | |''lvscan'' / ''lvs'' | | | |''lvdisplay'' | | ^ Create |''pvcreate'' | 3 | | |''vgcreate'' | | | |''lvcreate'' | | ^ Modification |''pvmove'' | 5 | | |''vgextend'' / ''vgreduce'' | 4 | | |''lvextend'' / ''lvreduce'' | | ^ Other |''cfdisk'' | 1 | | |''umount'' | 2 | | |''resize2fs'' | | ===== Adding free disk space to lvm ===== Adding free disc space to lvm: - Delete useless windows partition (don't forget to backup data!) in case there is no free disc space - use ''cfdisk /dev/hdb'' to create a partition, the type has to be ''8e'' to mark it as LVM controlled - ''umount /dev/hdb1'' (assuming you are dealing with hdb1) - ''pvcreate /dev/hdb1'' -> now there is a physical volume - ''vgextend lvm_vg1 /dev/hdb1'' -> extend volume group named ''lvm_vg1'' to physical device ''/dev/hdb1'' - ''pvmove /dev/hda4 /dev/hdb1'' -> move contents of ''/dev/hda4'' to ''/dev/hdb1'' - ''Entferne Datenträger aus Datenträgergruppe'' - using system-config-lvm tool - ''pvremove /dev/hda4'' ===== Last steps ===== * create filesystem * after resize: resize filesystem ''resize2fs'' (ext2/3)