Setup LVM on a blank disk

If you have a blank disk array, and want to prepare it for logical volumes, here’s how you do it:

1) Create the physical volume.
$ pvcreate /dev/cciss/c0d1
Physical volume “/dev/cciss/c0d1” successfully created

2) Create the volume group.
$ vgcreate volgroup2 /dev/cciss/c0d1
Volume group “volgroup2” successfully created

3) Make the volume group active.
$ vgchange -a y volgroup2
0 logical volume(s) in volume group “volgroup2” now active

4) Create your logical volumes.
$ lvcreate -L 5G -n d01_lv volgroup2
Logical volume “d01_lv” created

5) Create an EXT3 filesystem on the logical volume.
$ mke2fs -j /dev/volgroup2/d80_lv

6) Create a directory on the Linux filesystem to use as a mount point for the volume.
$ mkdir /d01

7) Edit the /etc/fstab file, adding an entry for the logical volume device and mount point.
/dev/volgroup2/d01_lv /d01 ext3 defaults 1 2

[Note: this was done on an HP server, hence the /dev/cciss/c0d1 device references. Other servers might use a /dev/sda reference, for example]