How To Raid In Linux With Mdadm?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/raid-linux-mdadm/
PINTEREST
PINTEREST
INSTAGRAM

Hi, today I am gonna show you how to make raid ( redundant array of inexpensive disks ). Why wee need it? Think about that you have customer data stored in a server. Say one day disk is dead and then all of your data about customer are gone. This is a very bad new.  What if disk dies but the data remains the same.

This will be very good. You can think that will disk dies frequently. No but it is not impossible, especially in enterprise side or in personal use in home. RAID is a technology to backup disks with extra disks. Say we have 3 disks which are used separate projects. And we want to backup them with high availibility in particular working hours. RAID can be done with separate hardware, firmware or software. Making raid with hardware is the best, fast and reliable way but it may be expensive or too much for project. Firmware raid is generally provided by motherboard manufacturers as a cheap option for hardware raid. Software raid is the cheapest and least reliable way to mail raid. But it can be suitable for home or unprofessional usage. I will not delve into details of raid levels. But you can find more about in wikipedia. In linux software raid consist of kernel module and user space programs.

3 disks are used actively to store data but 4. disk the or spare disk  is used to backup for 3 disks. It doesn’t store all data of the 3 disks as it is impossible if 3 disks are near to full.

First list disks. We will make array with vdb,vdc,vdd and vde disks. I make this in my vm so your disk names mabe different like sda, sdb etc. All disk have 1 GB.

Install mdadm in ubuntu with this command

If not load mdadm kernel module

Here we create raid. We should give count of disk with raid-devices level with leve and the disk to be used in raid. Here meta data is optional it sets raid metada version After the command is executed we got a message that says our new disk which we named md0 is created . If you wab to create raid0 use level=stripe and raid1 level=mirror

Also we got a mail about our raid operation. As you can see in message the pyshical disk are nuımbered and possibile future raid levels are provided with Personalities row.

To see raid devices status.Shows total disk count and total useable size which is 3/4 of the total disk size. As you can see version is 1.2 where we set it while creating the array

You can save raid configuration in file.

To see a disk status of array

Create file system for new disk

Mount the disk and create some files. Also show status of mounted disks

Say disk vdd is corrupted. And we need to remove it.

or add some disks

To use raid after restart. Raid devies must reassembled every time to use.

Resources:

https://raid.wiki.kernel.org/index.php/RAID_setup

Ubuntu 14.04 Server Guide

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/raid-linux-mdadm/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Qemu Tutorial

You may also like...

1 Response

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)