HOW TO CONFIGURE LVM OVER RAID

 

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

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.

lvm over raid

FOllow these steps:

  • Create three partitions
[root@dhcppc5 ~]# 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): +500M


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

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

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          62      497952   83  Linux
/dev/sdc6              63         124      497983+  83  Linux
/dev/sdc7             125         186      497983+  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 change these partitions type to raid .
[root@dhcppc5 ~]# 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): t
Partition number (1-7): 7
Hex code (type L to list codes): fd
Changed system type of partition 7 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-7): 6
Hex code (type L to list codes): fd
Changed system type of partition 6 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-7): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)

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          62      497952   fd  Linux raid autodetect
/dev/sdc6              63         124      497983+  fd  Linux raid autodetect
/dev/sdc7             125         186      497983+  fd  Linux raid autodetect

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
  • After changing its type we will create raid .
[root@dhcppc5 ~]# mdadm --create /dev/md5 --level=5 --raid-devices=3 /dev/sdc5 /dev/sdc6 /dev/sdc7

mdadm: array /dev/md5 started.
  • Now we have to convert this raid into physical volume
[root@dhcppc5 ~]# pvcreate /dev/md5
 
 Physical volume "/dev/md5" successfully created
  • We have to create volume group over physical volume
[root@dhcppc5 ~]# vgcreate vg55 /dev/md5
  
Volume group "vg55" successfully created
  • After volume group we will create logiacal volume over volume group.
[root@dhcppc5 ~]# lvcreate -L +800M -n lv1 vg55
 
 Logical volume "lv1" created

So this is how you can create LVM over raid. 

HOW TO CONFIGURE RAID OVER LVM

HOW TO CHANGE YOUR USB 2.0 TO USB 3.0 WITHOUT ANY SOFTWARE

HOW TO SEND A MESSAGE THAT WILL SELF-DESTRUCT IN RECIPIENT’S INBOX

2 thoughts on “HOW TO CONFIGURE LVM OVER RAID

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