HOW TO CONFIGURE RAID OVER LVM

In this tutorial we are going to learn how to create raid over lvm.

 

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.

RAID knows as redundant array of inexpensive disks,  is a  data storage virtualization technology that combines multiple physical disk drive components into a single logical units for the purposes of data redundancy.

raid over lvm

FOllow these steps to create raid over lvm :

  • 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): +800M

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

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (197-1634, default 197):
Using default value 197
Last cylinder or +size or +sizeM or +sizeK (197-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          98      787122   83  Linux
/dev/sdc6              99         196      787153+  83  Linux
/dev/sdc7             197         294      787153+  83  Linux

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
  •  Now we have to convert these partitions into physical volumes.
[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
  • After creating physical volumes we have to create volume groups over physical volumes.
[root@localhost ~]# vgcreate vg00 /dev/sdc5 /dev/sdc6 /dev/sdc7
  Volume group "vg00" successfully created
  • Now we will create logical volume over volume group
[root@localhost ~]# lvcreate -L +500M -n lv1 vg00
  Logical volume "lv1" created
[root@localhost ~]# lvcreate -L +500M -n lv2 vg00
  Logical volume "lv2" created
  • Now its time to configure raid over lvm
[root@localhost ~]# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/vg00/lv1 /dev/vg00/lv2

mdadm: array /dev/md1 started.
  • You can check
[root@localhost ~]# cat /proc/mdstat

Personalities : [raid6] [raid5] [raid4] [raid1]
md1 : active raid1 dm-1[1] dm-0[0]
      511936 blocks [2/2] [UU]
md6 : active raid6 sda6[1] sda5[0]
      995712 blocks level 6, 64k chunk, algorithm 2 [4/2] [UU__]
unused devices: <none>

HOW TO CONFIGURE SWAP OVER LVM

WHAT IS LVM AND HOW TO CONFIGURE ?

RAID1 AND ITS CONFIGURATION

4 thoughts on “HOW TO CONFIGURE RAID OVER LVM

  1. I’ve been surfing online greater than three hours these days, but I never found any interesting article
    like yours. It is pretty value sufficient for me. Personally,
    if all site owners and bloggers made just right content as you did,
    the net will probably be a lot more helpful than ever before.

    Like

  2. Fantastic goods from you, man. I have understand your stuff previous to and you are just too fantastic.
    I actually like what you have acquired here, certainly like what you’re
    stating and the way in which you say it. You make it enjoyable and you still care for to
    keep it smart. I cant wait to read much more from you.

    Like

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