The best guide is here:-
HowtoForge-LVM
This has all the basics on creating/moving/resizing/deleting physical volumes, volume groups and logical volumes. There is also a tutorial on creating a raid1 disk using LVM.
I had a bad corruption while using virtual machines on this disk if something corrupts on a partionion i recommend you back up everything on all partiitions straight away before deleting the corrupted partition.
one thing it forgets to mention is to install system-lvm-tools (a very handy tool for managing volumes)

and also to modprobe device-mapper - you cant create logical volumes without it. (might be necessary to add to /etc/modules)

sudo modprobe dm-mod

Creating a snapshot

from the logical volume you create another logical volume that is a snapshot of the first by using the -s flag. The full space seems to be reserved

sudo lvcreate -s -L50G -n vmware1snap /dev/data/vmware1
then mount it and youre away! no copy :)

Scanning for removable drive in the volume group

if all drive in the volume group aren't connected (i.e. usbdisks) then use 'vgscan' to scan the group first.

sudo vgscan
then mount
sudo mount /dev/data/store /mnt/store/

Unmounting a volume group

set vg inactive, then sync.

sudo vgchange -an data
sudo sync
the drive can the be unplugged.

some commands

commanddescription
fdisk /dev/sdbstart partitioning physical device (make partition type 8e)
pvcreate /dev/sdb1create physical volume
pvremove /dev/sdb1remove physical volume (like unmount)
pvmove /dev/sdb1 /dev/sdf1move physical volume
pvdisplaydiplsay physical volumes
vgcreate VG_NAME /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1create volume group
vgdisplaydisplay volume groups
vgrename VG_NAME NEW_VG_NAMErename volume group
vgscanscan for volume groups
vgextend VG_NAME /dev/sdf1add physical device to volume group
vgreduce VG_NAME /dev/sdb1remove physical volume from volume group
vgchange -an datamark volume group active(-ay) or inactive(-an)
lvcreate --name LV_NAME --size 40G VG_NAMEcreate logical volume with name and size
lvcreate -s -L50G --name LV_NAME_NEW /dev/VG_NAME/LV_NAMEcreate snapshot logical volume with name and size
lvdisplaydisplay logical volume names
lvscanscan for logical volumes
lvrename VG_NAME LV_NAME NEW_LV_NAMErename logical volume
lvremove /dev/VG_NAME/LV_NAMEdelete volume group
lvextend -LNEW_SIZE /dev/VG_NAME/LV_NAMEextend logical volume to NEW_SIZE (e.g.40G)
lvreduce -LNEW_SIZE /dev/VG_NAME/LV_NAMEreduce logical volume to NEW_SIZE (e.g.40G)
mkfs.ext3 /dev/VG_NAME/LV_NAMEmake ext3 filesystem on logical volume
e2fsck -f /dev/VG_NAME/LV_NAMEcheck filesystem on logical volume
resize2fs /dev/VG_NAME/LV_NAMEresize ext2 partition (after using lvextend)

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 1.6.1.13621 - Documentation