LVM On Linux

LinuxAre. LVM On Linux

What is LVM? and what is Linux LVM? Ok, I just know linux but not with LVM. Ok! We have curios questions! LVM is stands for Logical Volume Manager for linux kernel but that abbreviation is different for HP-UX, IBM AIX and OS/2. For them, LVM stands for Logical Volume Management. Written in 1998 by Heinz Mauelshagen. Logical Volume Manager (LVM) on ubuntu, its similar to Windows Dynamic Disk or Window’s Dynamic Volume. It used for emerging many hard drive (storage) to one mpunt point / partition.

Features

  • Resize volume groups directly
  • Resize logical volumes (LV) directly
  • Create read-only snapshots of logical volumes (LVM1).
  • Create read-write snapshots of logical volumes (LVM2).
  • Stripe whole or parts of logical volumes across multiple PVs, this is similar to RAID 0
  • Mirror whole or parts of logical volumes, similar to RAID 1.
  • Move online logical volumes between PVs.
  • Split or merge volume groups in situ (as long as no logical volumes span the split).

lvm

Implementation
If you have installed any linux such as ubuntu, fedora, CentOS, debian, or any kind of linux distro or distribution. We’re sure you have configured the partition at least once. Now, we want configure lvm manually.

Install LVM2 module : sudo apt-get install lvm2
check your partition : fdisk -l
choose the partition then create a logical and assign volume :

1. Physical Volume Assignment

pvcreate /dev/sdax /dev/sdbx (replace x with your partition number)

2. Creating Volume Group

vgcreate vg_home /dev/sdax
vgextend vg_home /dev/sdbx

Assign Size to Volume Group.

lvcreate -L10G -nopt vg_home
lvcreate -L5G -nhome vg_home
lvcreate -L2G -ntmp vg_home

Activating Volume Group

vgchange -a y

Format that volume. So, we can use that

mke2fs -j /dev/vg_home/opt
mke2fs -j /dev/vg_home/home
mke2fs -j /dev/vg_home/tmp

Before use that, we must create mount points first then mount the volumes

Create Mount Point

mkdir -p /mnt/lvm/home
mkdir -p /mnt/lvm/opt
mkdir -p /mnt/lvm/tmp

Mounting the mount point

mount /dev/vg_home/home /mnt/lvm/home
mount /dev/vg_home/opt /mnt/lvm/opt
mount /dev/vg_home/tmp /mnt/lvm/tmp

Check The Mount Point

df -h

If the command result shows /dev/mapper/vg_home-home, /dev/mapper/vg_home-opt and /dev/mapper/vg_home-tmp, you are success! Go  to get more information about lvm. If you have words and want to keep in touch with us, go to contact page. We are very appreciate every words to us

About Eko Priambodo

I'm a student of an indonesia vocational school in yogyakarta. I study about Information Technology that concern on networking stuffs especially linux. I'm an techno savvy and enthusiast. So, if you talking to me about networking and linux, we will be making time move quickly. Sincerely

18. January 2012 by Eko Priambodo
Categories: Sharing, Tuts | Tags: , , , , , , , , , , , , | Leave a comment

Leave a Reply

Required fields are marked *

*