Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software RAID on linux with mdadm Campus-Booster ID: 38503 www.supinfo.com Copyright © SUPINFO. All rights reserved Software RAID.

Similar presentations


Presentation on theme: "Software RAID on linux with mdadm Campus-Booster ID: 38503 www.supinfo.com Copyright © SUPINFO. All rights reserved Software RAID."— Presentation transcript:

1 Software RAID on linux with mdadm Campus-Booster ID: 38503 www.supinfo.com Copyright © SUPINFO. All rights reserved Software RAID

2 Your trainer… Presenter’s Name Software RAID Title: **Enter title or job role. Accomplishments: **What makes the presenter qualified to present this course. Education: **List degrees if important. Publications: **Writings by the presenter on the subject of the course or presentation. Contact: **Campus-Booster ID: presenter@supinfo.com

3 Create a loop device: to use RAID without additional disk Know all differents RAID levels: choose the level for your need Install and configure RAID software: when we had no hardware solution Monitoring RAID devices: to be alerted of arrays problem By completing this course, you will: Software RAID Course objectives

4 Loop devices: know and manipulate loop devices System preparation: Configure the linux kernel and disks to use RAID mdadm installation: the software RAID solution RAID implementation: increase performance and implement fault tolerance Monitoring and maintenance: Change disk or be aware of any problems Software RAID Course’s plan: Course topics

5 Loop Devices Introduction to Loop Devices Software RAID

6 Preview Loop devices Here are chapters we will talk about: Loop devices presentation Example

7 Presentation Loop devices Loopback device Same operations as a real disk, example: Can be bound to a file FileVirtual disk Become /dev/loop[0-7] fdisk /dev/loop0 mkfs.ext3 /dev/loop0

8 Example Loop devices Creation of a 10Mo file Bind /dev/loop0 device to image.loop Unbind: dd if=/dev/zero of=image.loop bs=1024k count=10 losetup /dev/loop0 image.loop losetup –d /dev/loop0

9 Stop-and-think Loop devices Do you have any questions ?

10 Introduction to RAID Redundant Array of Independent Disks Software RAID

11 Preview RAID introduction Here are the chapters we will see: Introduction Stripping Mirroring RAID 5 RAID 1+0

12 Abbreviation R edundant A rray of I ndependent D isks

13 Introduction Objective: using inexpensive disks Disks aggregation: the OS only sees one logical disk. Disks capacity addition (RAID 0, JBOD)‏ Enhanced performance (RAID 0, 5)‏ Fault tolerance (RAID 1, 5)‏ Increase capacity, performance, security (RAID 5)‏ Hardware and Software implementation IMPORTANT: it's not a backup solution! RAID introduction

14 Raid – Historique 1987, Berkeley University: birth of the first 5 Raid levels RAID (1-5)‏ Raid 0, 6, 7 and Jbod added after  Level 0 and Jbod without fault tolerance (no redundancy)‏ RAID introduction

15 RAID 0 (Stripping)‏ RAID 0 Enhanced performance No fault tolerance RAID introduction

16 RAID 1 (mirroring)‏ Raid level 1 or Mirroring Fault tolerance Enhanced performance on data reading Disadvantage: not very disk space efficient 2 Disks of 40Go = 1 Raid device of 40Go RAID introduction

17 RAID 5 Raid level 5 Mix between reliability and performance Read/Write Data on all disks Parity check system RAID introduction

18 RAID 1+0 Raid 1+ Raid 0 Need 4 Disks minimum Mix Raid 0 performance with Raid 1 Reliability RAID introduction

19 Stop-and-think RAID introduction Do you have any questions ?

20 Software Raid Implementation Software Raid installation on Linux Software RAID

21 Preview Software RAID implementation These are the chapters that we will approach : Kernel configuration mdadm installation Disks preparation RAID device

22 Kernel configuration Linux kernel must support Raid devices 1 Verify Raid support: 2 Reconfigure the kernel if needed: Software RAID implementation cat /boot/config-2.6.x | grep RAID

23 mdadm installation mdadm: Tool to manage raid devices Install from sources: http://neil.brown.name/blog/mdadm Mandriva: urpmi mdadm Software RAID implementation

24 Disks preparation Partitions need to support raid 1 disk = only 1 partition Warning: All data will be lost ! 1 Launch fdisk or any other partition manager of your choice 2 Create a partition for the entire disk 3 Modify partition type to type FD (Linux RAID autodetect)‏ Software RAID implementation fdisk /dev/hdb

25 Raid device Raid device = Virtual partition Represented by: /dev/md  X is a number: 0 to 15  Example: /dev/md1  16 Raid partitions maximum No partitioning required on raid device. Software RAID implementation

26 Stop-and-think Software RAID implementation Do you have any questions ?

27 Configuration and use of Software RAID Implementation of different Raid types. Software RAID

28 Preview Configuration and use of Software RAID These are the chapters that we will approach : The mdadm command RAID 1 Implementation RAID 5 Implementation RAID 0+1 Implementation

29 The mdadm command Only one command for all management: mdadm --create : Raid device to create (/dev/md1)‏ --level= : Raid level (0,1,5,...)‏ --raid-devices= : number of physical disks and their access path Configuration of Software RAID mdadm --create --level= \ > --raid-devices=... mdadm --create --level= \ > --raid-devices=...

30 Raid 1 implementation Data duplicated: writing synchronously on all disks 2 disks minimum Creation of a Raid 1 device /dev/md0 Mirroring of /dev/sdb1 and /dev/sdc1 Configuration of Software RAID mdadm --create /dev/md0 --level=1 \ > --raid-devices=2 /dev/sdb1 /dev/sdc1 mdadm --create /dev/md0 --level=1 \ > --raid-devices=2 /dev/sdb1 /dev/sdc1

31 Raid 5 implementation Fault tolerance and performance 3 disks minimum Configuration of Software RAID mdadm --create /dev/md1 --level=5 \ > --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 \ > --spare-devices=1 /dev/sde1 mdadm --create /dev/md1 --level=5 \ > --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 \ > --spare-devices=1 /dev/sde1

32 Raid 1+0 implementation Raid 1 + Raid 0 First we create two RAID 1 Configuration of Software RAID mdadm --create /dev/md1 --level=1 \ > --raid-devices=2 /dev/sdd1 /dev/sde1 mdadm --create /dev/md1 --level=1 \ > --raid-devices=2 /dev/sdd1 /dev/sde1 mdadm --create /dev/md2 --level=0 \ > --raid-devices=2 /dev/md0 /dev/md1 mdadm --create /dev/md2 --level=0 \ > --raid-devices=2 /dev/md0 /dev/md1 mdadm --create /dev/md0 --level=1 \ > --raid-devices=2 /dev/sdb1 /dev/sdc1 mdadm --create /dev/md0 --level=1 \ > --raid-devices=2 /dev/sdb1 /dev/sdc1 And then the RAID 0 from the two RAID 1 sets

33 Stop-and-think Configuration of Software RAID Do you have any questions ?

34 Maintenance and monitoring Maintenance and monitoring of Raid devices Software RAID

35 Preview Maintenance and monitoring These are the chapters that we will approach : Simulate a faulty disk Hot add / remove Monitoring your arrays

36 Simulate a faulty disk Hot add and remove of disk Simulate a faulty disk: See the changes: 1 2 Maintenance and monitoring mdadm /dev/md0 -f /dev/sdc1 mdadm --detail /dev/md0 [ ? ] Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 49 1 active sync /dev/sdd1 2 8 33 - faulty /dev/sdc1 mdadm --detail /dev/md0 [ ? ] Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 49 1 active sync /dev/sdd1 2 8 33 - faulty /dev/sdc1

37 Hot add / remove Hot add and remove of disk Remove /dev/sdc1 Add the spare disk /dev/sde1 3 4 Maintenance and monitoring mdadm /dev/md0 -r /dev/sdc1 mdadm /dev/md0 -a /dev/sde1

38 Monitoring your arrays Get mail alerts about your RAID array state: Maintenance and monitoring mdadm -F --scan -f --delay 30 --pid-file \ > /var/run/mdadm.pid -m labo-linux@supinfo.com mdadm -F --scan -f --delay 30 --pid-file \ > /var/run/mdadm.pid -m labo-linux@supinfo.com

39 Stop-and-think Maintenance and monitoring Do you have any questions ?

40 RAID levels Mdadm command RAID maintenance & monitoring Course summary Loop devices Software RAID

41 Congratulations You have successfully completed the SUPINFO course Software Raid

42 The end


Download ppt "Software RAID on linux with mdadm Campus-Booster ID: 38503 www.supinfo.com Copyright © SUPINFO. All rights reserved Software RAID."

Similar presentations


Ads by Google