Introduction
Setup
to include: http://wiki.bluelightav.org/display/BLUE/LVM+Howto
On Linux Debian and Ubuntu
We will assume that you create the LVM on a RAID partition called md1. Adapt this to your situation.
Also replace pinkflower by a relevant name identifying your volume group.
Create the physical volume
pvcreate /dev/md1
Create the virtual group
vgcreate pinkflower /dev/md1
Create the logical volumes
Here we are going to create an LV for swap. 10G gives the size of the volume (10 Gb). Adapt it to your needs
lvcreate -L 10G -n root pinkflower
If you want to create other volume, check the space left on the group with the following command:
vgs
To add another volume redo the lvcreate step.
Create the file system
mkfs.ext4 /dev/pinkflower/root
Check the filesystem
lvs
Outdated
Resize existing file system without LiveCD
pvs PV VG Fmt Attr PSize PFree /dev/sda3 rose lvm2 a- 144.85G 44.85G lvm lvm> lvs LV VG Attr LSize Origin Snap% Move Log Copy% home rose -wi-ao 50.00G opt rose -wi-ao 10.00G root rose -wi-ao 10.00G tmp rose -wi-ao 10.00G var rose -wi-ao 20.00G lvm> lvresize -L +30G /dev/rose/home Extending logical volume home to 80.00 GB Logical volume home successfully resized lvm> quit Exiting. resize_reiserfs -s +30G /dev/rose/home df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rose-home 80G 49G 32G 61% /home
Using LVM on Live CD
here is a great howto getting LVM working.
what I did here was
aptitude install lvm2 dmsetup modprobe dm-mod pvscan vgscan vgchange -a y
and all the lvm's are active and mountable
LVM on RAID
A great howto is here http://www.gagme.com/greg/linux/raid-lvm.php