WHAT IS LVM AND HOW TO CONFIGURE ?

 

In this tutorial we are going to learn how to create lvm . Before creating it lets checkout what lvm really is .

Lvm is basically a device mapper that provides logical volume management for linux creating on multiple physical volumes.And actually Lvm is made on volume group and volume group  can be resized by absorbing physical volumes.

lvm

TO CONFIGURE FOLLOW THESE STEPS:

  • Create Three partitions 
[root@localhost ~]# fdisk /dev/sdc
The number of cylinders for this disk is set to 1634.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)


Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (1-1634, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1634, default 1634): +400M


Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (51-1634, default 51):
Using default value 51
Last cylinder or +size or +sizeM or +sizeK (51-1634, default 1634): +600M


Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (125-1634, default 125):
Using default value 125
Last cylinder or +size or +sizeM or +sizeK (125-1634, default 1634): +800M


Command (m for help): p
Disk /dev/sdc: 13.4 GB, 13445111808 bytes
255 heads, 63 sectors/track, 1634 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc4               1        1634    13125073+   5  Extended
/dev/sdc5               1          50      401562   83  Linux
/dev/sdc6              51         124      594373+  83  Linux
/dev/sdc7             125         222      787153+  83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
  • NOW WE HAVE TO CONVERT THESE PARTITIONS INTO PHYSICAL VOLUME
[root@localhost ~]# pvcreate /dev/sdc5 /dev/sdc6 /dev/sdc7


  Physical volume "/dev/sdc5" successfully created
  Physical volume "/dev/sdc6" successfully created
  Physical volume "/dev/sdc7" successfully created
  • Create volume group using these physical volumes
[root@localhost ~]# vgcreate vg00 /dev/sdc5 /dev/sdc6 /dev/sdc7 

Volume group "vg00" successfully created
  • After creating volume group we will create logical volume (LVM)
[root@localhost ~]# vgcreate vg00 /dev/sdc5 /dev/sdc6 /dev/sdc7
 Volume group "vg00" successfully created
  • NOW ITS TIME FOR LVM CREATION
[root@localhost ~]# lvcreate -L +500M -n lv1 vg00
  Logical volume "lv1" created


[root@localhost ~]# lvcreate -L +300M -n lv2 vg00
  Logical volume "lv2" created


[root@localhost ~]# lvcreate -L +450M -n lv3 vg00
  Rounding up size to full physical extent 452.00 MB
  Logical volume "lv3" created


[root@localhost ~]# lvcreate -L +350M -n lv4 vg00
  Rounding up size to full physical extent 352.00 MB
  Logical volume "lv4" created

You can check by

[root@localhost ~]# lvs
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lv1  vg00 -wi-a- 500.00M
  lv2  vg00 -wi-a- 300.00M
  lv3  vg00 -wi-a- 452.00M
  lv4  vg00 -wi-a- 352.00M

HOW TO CONFIGURE SWAP OVER LVM

HOW TO CREATE UNDETECTED VIRUS

HOW TO CONFIGURE RAID OVER LVM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s