LVM2 How To
Uncategorized
Add comments
Feb 102008
Do you have the need for speed???… OK OK enough with the comments
…Before reading this tutorial you should understand a little how LVM works
How to create a physical volume, volume group, and logical volume.
-
-
First thing we have to do is initialize the disk..
- Figure out which disk and partitions you have that are being used df -h.
- Now we need to run fdisk -l and see all the partitions, including the ones that we have that are not mounted up
- Now that we know which disks and partitions that you can not destroy, we can start our process of creating lvm volumes.
-
-
Here we will start with the initialization of the lvm volumes.(Either we use the entire disk or a partition)Here we will show you on partitions.
- Lets initialize the first partition..
pvcreate /dev/sda1. - Now lets initialize the second partition..
pvcreate /dev/sdb1. - To display info on the physical volume, just run this
pvdisplay.
- Lets initialize the first partition..
-
-
Now that both partitions have been initialized, it is time to create the volume group and activate it.
- vgcreate linuxdynasty /dev/sda1 /dev/sdb1
- vgchange -a y linuxdynasty
- To display info on the volume group, just run this
vgdisplay.
-
-
We have reached the final step (for the LVM part of it).
- Now we create the logical volume.
lvcreate -L10G -nHomeLV linuxdynasty - To display info on the logical volume, just run this
lvdisplay.
- Now we create the logical volume.
-
-
Final steps, we need to make a file system on that volume and mount it.
- First, we create the file system
mkfs.ext3 /dev/linuxdynasty/HomeLV - Second, we mount the file system
mount -t ext3 /dev/linuxdynasty/HomeLV /home
- First, we create the file system