Linux Software Raid. Aug 2010. Mark A. Davis



Similar documents
How To Set Up Software Raid In Linux (Amd64)

Setup software RAID1 array on running CentOS 6.3 using mdadm. (Multiple Device Administrator) 1. Gather information about current system.

LVM and Raid. Scott Gilliland

Guide to SATA Hard Disks Installation and RAID Configuration

Guide to SATA Hard Disks Installation and RAID Configuration

These application notes are intended to be a guide to implement features or extend the features of the Elastix IP PBX system.

Installing Debian with SATA based RAID

VIA Fedora Linux Core 8 (x86&x86_64) VT8237R/VT8237A/VT8237S/VT8251/CX700/VX800 V-RAID V3.10 Driver Installation Guide

Typing some stupidities in text files, databases or whatever, where does it fit? why does it fit there, and how do you access there?

Guide to SATA Hard Disks Installation and RAID Configuration

Hard Disk Drives and RAID

NVIDIA RAID Installation Guide

RAID User Guide. Edition. Trademarks V1.0 P/N: C51GME0-00

VIA RAID Installation Guide

Guide to SATA Hard Disks Installation and RAID Configuration

Support for Storage Volumes Greater than 2TB Using Standard Operating System Functionality

Version : 1.0. SR3620-2S-SB2 User Manual. SOHORAID Series

Ubuntu bit + 64 bit Server Software RAID Recovery and Troubleshooting.

Chapter 2 Array Configuration [SATA Setup Utility] This chapter explains array configurations using this array controller.

Unix System Administration

DELL RAID PRIMER DELL PERC RAID CONTROLLERS. Joe H. Trickey III. Dell Storage RAID Product Marketing. John Seward. Dell Storage RAID Engineering

HARDWARE SUBRAID. SUBRAID MAX II STD rebuilds backup system

Distribution One Server Requirements

Shared Storage Setup with System Automation

User s Manual. Home CR-H BAY RAID Storage Enclosure

RAID HARDWARE. On board SATA RAID controller. RAID drive caddy (hot swappable) SATA RAID controller card. Anne Watson 1

Introduction. What is RAID? The Array and RAID Controller Concept. Click here to print this article. Re-Printed From SLCentral

Guide to SATA Hard Disks Installation and RAID Configuration

VIA / JMicron RAID Installation Guide

RAID Manual. Edition. Trademarks V1.0 P/N: CK8-A5-0E

Benefits of Intel Matrix Storage Technology

RAID Storage System of Standalone NVR

Practical issues in DIY RAID Recovery

VERY IMPORTANT NOTE! - RAID

RAIDCore User Manual P/N Revision A December 2009

SiS S-ATA User s Manual. Quick User s Guide. Version 0.1

LBNC and IBM Corporation Document: LBNC-Install.doc Date: Path: D:\Doc\EPFL\LNBC\LBNC-Install.doc Version: V1.0

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System

Storage node capacity in RAID0 is equal to the sum total capacity of all disks in the storage node.

RAID Utility User Guide. Instructions for setting up RAID volumes on a computer with a Mac Pro RAID Card or Xserve RAID Card

SiS 180 S-ATA User s Manual. Quick User s Guide. Version 0.1

Configuring ThinkServer RAID 100 on the Lenovo TS430

RAID installation guide for ITE8212F

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

Creating a Cray System Management Workstation (SMW) Bootable Backup Drive

WES 9.2 DRIVE CONFIGURATION WORKSHEET

LSI Software RAID Configuration Utility

SiS964 RAID. User s Manual. Edition. Trademarks V1.0 P/N: U49-M2-0E

PCI Express 2.0 SATA III RAID Controller Card with Internal Mini-SAS SFF-8087 Connector

RAID Utility User s Guide Instructions for setting up RAID volumes on a computer with a MacPro RAID Card or Xserve RAID Card.

Adaptec ASR-7805/ASR-7805Q/ASR-71605/ASR-71605Q/ASR-71605E/ASR-71685/ASR SAS/SATA RAID Controllers AFM-700 Flash Backup Unit

RAID Rebuilding. Objectives CSC 486/586. Imaging RAIDs. Imaging RAIDs. Imaging RAIDs. Multi-RAID levels??? Video Time

GENERAL INFORMATION COPYRIGHT... 3 NOTICES... 3 XD5 PRECAUTIONS... 3 INTRODUCTION... 4 FEATURES... 4 SYSTEM REQUIREMENT... 4

How To Manage Your Volume On Linux (Evms) On A Windows Box (Amd64) On A Raspberry Powerbook (Amd32) On An Ubuntu Box (Aes) On Linux

Intel Rapid Storage Technology enterprise (Intel RSTe) for Linux OS

RAID Made Easy By Jon L. Jacobi, PCWorld

XL-RAID-SATA2-USB. User Manual. v.1.2 (January, 2010)

Redundant Array of Inexpensive/Independent Disks. RAID 0 Disk striping (best I/O performance, no redundancy!)

Replacing a Laptop Hard Disk On Linux. Khalid Baheyeldin KWLUG, September 2015

How To Set Up A Raid On A Hard Disk Drive On A Sasa S964 (Sasa) (Sasa) (Ios) (Tos) And Sas964 S9 64 (Sata) (

SiS964/SiS180 SATA w/ RAID User s Manual. Quick User s Guide. Version 0.3

README.TXT

Cloning Complex Linux Servers

An Affordable Commodity Network Attached Storage Solution for Biological Research Environments.

Ultra ATA 133 RAID PCI Pro

EMC Backup and Recovery for Microsoft SQL Server 2008 Enabled by EMC Celerra Unified Storage

Intel ESB2 SATA RAID Setup Guidelines

Intel Matrix Storage Manager 8.x

How To Use A Raid

Intel Rapid Storage Technology

RAID EzAssist Configuration Utility Quick Configuration Guide

SATA+Ultra ATA RAID CONTROLLER RC212. User Manual

AMD RAID Installation Guide

Redundant Array of Independent Disks (RAID)

Summer Student Project Report

USER S GUIDE. MegaRAID SAS Software. June 2007 Version , Rev. B

LVM2 data recovery. Milan Brož LinuxAlt 2009, Brno

Intel Rapid Storage Technology (Intel RST) in Linux*

RAID Level Descriptions. RAID 0 (Striping)

HP StorageWorks Modular Smart Array 1000 Small Business SAN Kit Hardware and Software Demonstration

Data storage, backup and restore

Installing a Second Operating System

AMD RAID Installation Guide

Configuring a SSD RAID-0 Array on an AMD System

PA-5000 Series SSD Storage Options Configuring RAID and Disk Backup

This user guide describes features that are common to most models. Some features may not be available on your computer.

PCI Express SATA / esata 6Gb/s RAID Card User Manual

Home storage and backup options. Chris Moates Head of Lettuce

PCIe SATA 6G Raid Card

Resilient NAS by Design. Buffalo. A deployment guide to disaster recovery. Page 1

Cisco Small Business NAS Storage

PCIe AHCI-IP Demo Instruction Rev Jul-15

Data Storage and Backup. Sanjay Goel School of Business University at Albany, SUNY

VIA RAID configurations

User Guide - English. Embedded MegaRAID Software

RAID installation guide for Silicon Image SiI3114

Transcription:

Linux Software Raid Aug 2010 Mark A. Davis a

What is RAID? Redundant Array of Inexpensive/Independent Drives It is a method of combining more than one hard drive into a logic unit for the purpose of: Increasing Fault Tolerance Increasing Performance Or both RAID has been around a long time 1 2 3

There are three ways to accomplish RAID: Fake RAID/BIOS RAID Hardware RAID Software RAID Each has its own set of advantages and disadvantages. And these vary depending on operating system and type of application.

Hardware RAID is where a dedicated set of hardware performs the actual work. Usually, quality hardware RAID will be: The most reliable The fastest performance The least amount of CPU load on the host system But it is also: The most expensive solution Inflexible Not very portable

Real hardware RAID controllers are expensive. Beware, controllers under $200 are not hardware RAID, they are FAKE RAID on a card. Linux support for hardware RAID is very good, especially from places like 3Ware and LSI. Typically, you can setup your RAID at boot time from a BIOS on the controller card. It is then completely transparent to the OS. You can even boot from a hardware RAID. You can optionally install Linux software that will monitor the RAID for failures, warnings, and to perform builds, rebuilds, etc. Hardware RAID can be SATA, SAS, or a combination. Can be picky about drive type.

If your hardware RAID controller dies, you will lose your whole array. Hardware RAID formats are proprietary, so if you have to replace the controller, you will likely have to rebuild the array from scratch if it is not the same model card. Rebuilding large arrays (multi TB) can take a LONG time. If you can't or don't run Linux software for the card, you have to use the card BIOS to build, meaning your system is down.

Fake/BIOS RAID is achieved through assistance of the BIOS/chipset on a motherboard. Lower reliability Lowest portability Low expense High CPU usage on the host Often inflexible The RAID work is mostly done by the host CPU and requires special OS drivers. Often these are not Linux compatible. Yet it is still dependent on the motherboard- and if that is fried or damaged, your RAID might be toast.

Fake/BIOS RAID puts the same amount of load on your computer CPU as software RAID. Fake RAID has most of the disadvantages of hardware RAID (except price) and ALL of the disadvantages of software RAID. Plus it has additional disadvantages, like having to run special or foreign kernel modules that might break with upgrades, might not be auto-installed, and are often not well documented or tested. So... Don't use Fake RAID under Linux!

Software RAID is performed completely in the native OS (Linux). Lowest cost Highest portability High reliability High CPU usage on the host machine Most flexible Unlike fake RAID, it is not tied to a motherboard and requires no special drivers. Unlike hardware RAID, it is not tied to a specific controller.

Linux software RAID can usually be setup at installation time (Mandriva's disk drake, for example, is extremely friendly). It can also be set up using a rescue disc. You can optionally run a monitoring daemon under Linux to watch the array. Software RAID is only suitable if you have spare CPU power. A huge multi-user system would not be appropriate for software RAID. But a multicore, single user system has tons of extra CPU. If you use software RAID on old IDE drives, make sure to have only 1 drive per cable! No such problem with SATA/SAS.

There are various types of RAID depending on your needs and requirements. The most popular three are: RAID 0: Striping RAID 1: Mirroring RAID 5: Striping & Parity You can perform all three using software RAID under Linux. There are other types of RAID also, but we will ignore them for simplicity :)

Software RAID types comparison RAID Type CPU/ Fault Controller Toleran Load ce Perform- Complex Minimum ance -ity Drives Boost No RAID Low None None RAID 0 Medium RAID 1 RAID 5 Low 1 Medium 2 High Worse Highest than no RAID High None Low 2 High High High 3 High

RAID 0 is used only for performance. The data blocks are split over two or more hard drives. This directly speeds performance because you can read data from or write to several drives at the same time. A two drive RAID 0 array is roughly twice the performance of a single drive. And a three drive array is about three times the performance. The catch? Your fault tolerance is actually LOWER than no RAID at all! If one drive fails, both will go down.

RAID 1 is used only for fault tolerance/ redundancy. The data blocks are mirrored over two drives (or pairs of drives). There is no increase in performance. But without the striping of RAID 0, each drive can be read without any special mounting or drivers. Remember- fault tolerance is NOT A BACKUP, it only protects against drive failure. It will not do a thing to protect against accidental erasure, filesystem corruption, controller failure, nor malware damage!!!

RAID 5 is used for both performance AND fault tolerance. It is the best of both worlds, combining traits of RAID 0 and RAID 1. The catch is that it requires at least 3 hard drives, it is more complex to setup and manage, and uses the most CPU. RAID 5 is an ideal technology for servers. Although software RAID 5 is not the best choice for large/multiuser systems.

There are performance limits to using software RAID with striping (like RAID 0 and RAID 5) when using on-motherboard SATA controllers. The problem is that as you add more drives to your array, the performance gets faster and faster until it will saturate SOMETHING on your system. The problem is that it is hard to know where the limits are. It is unlikely that a 3 drive array will saturate most motherboard controllers. You might even get away with 4 drives. But if you need more drives or performance than that, you might want to look at a hardware based controller with a very fast connection (PCIe 16x).

What did Mark choose for his home Linux system and why? I had two 1TB hard drives. I use one as an rsync backup of the first. So I have redundancy (but no fault tolerance, which is OK on a home system). I needed more space and wanted more performance at the same time... especially since I had upgraded the motherboard to a 6 core Phenom II. I liked my backup/rsync/spindown method and wanted to retain that... 1TB Main drive rsync 1TB Backup drive

I bought a 2TB drive and 4 trayless removable drive bays. 1TB sda Created a 2TB RAID 0 array across my 2 TB RAID 0 older two drives. Then I use the third, new, 2TB drive as my backup/rsync 1TB drive. sdb I timed it with new installation of Mandriva 2010.1, which I had planned to install anyway. I installed new 2TB drive and rsynced to it first. Then installed 2010.1 and created array. After installation, I copied back my data files (pics, music, docs, etc from the rsync drive. rsync 2TB Backup sdc

But what about LVM? Couldn't I have just spanned the two drives together that way? Well yes. I could have. But then I would not gain any performance. And I was really after performance just as much as additional space. Interestingly, you can combine software RAID and LVM, although it gets a lot more complicated. :) When you create a RAID, you end up with a new device called md0 (MultiDrive 0). More on that later. Let's see what software RAID0 looks like:

Now for a more traditional look at the situation: Disk /dev/sda: 1000.2 GB, 1000204886016 bytes Device Boot /dev/sda1 * /dev/sda2 /dev/sda3 Start 1 510 637 End 509 636 121601 Blocks 4088511 1020127+ 971651362+ Id 82 83 fd System Linux swap / Solaris Linux Linux raid autodetect Id 82 83 fd System Linux swap / Solaris Linux Linux raid autodetect Id 83 System Linux Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes Device Boot /dev/sdb1 * /dev/sdb2 /dev/sdb3 Start 1 510 637 End 509 636 121601 Blocks 4088511 1020127+ 971651362+ Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes Device Boot /dev/sdc1 Start 1 End 243201 Blocks 1953512001 Disk /dev/md0 doesn't contain a valid partition table

And some more: [root@kram /]# cat /etc/fstab /dev/md0 / ext4 acl,noatime,nodiratime 1 1 # Entry for /dev/sda2 : UUID=2c928ae8-d406-4392-87c3-0d15001dd38a /boot ext4 acl,noatime,nodiratime 1 2 /dev/cdrom /media/cdrom auto umask=0,users,iocharset=utf8,noauto,ro,exec 0 0 none /proc proc defaults 0 0 # Entry for /dev/sda1 : UUID=979c7fd9-4d0d-4e5a-8494-e24b4fd5e642 swap swap defaults 0 0 # Entry for /dev/sdb1 : UUID=dc32ec5f-589f-4371-9638-2aebd38a8237 swap swap defaults 0 0 [root@kram /]# mount /dev/md0 on / type ext4 (rw,noatime,nodiratime,acl) none on /proc type proc (rw) /dev/sda2 on /boot type ext4 (rw,noatime,nodiratime,acl) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) gvfs-fuse-daemon on /home/mark/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=mark) [root@kram /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/md0 1.8T 864G 868G 50% / /dev/sda2 981M 29M 902M 4% /boot

Did you notice there was a small, 1GB ext4 boot partition at the beginning of both sda and sdb? This is because when you first bootstrap the system, you need a place to put the kernel that is not inside a RAID volume. Since it is software RAID, the kernel drivers have to be loaded BEFORE the RAID volume can be decoded and read. Some systems CAN boot software RAID from GRUB, but it seemed a lot more complex and risky so I decided it wasn't worth the bother. Note that swap is also outside the RAID volume. It can be inside the array, if necessary. I just thought it made sense to keep it out. Linux will interleave the two swap areas

But how does it perform? Did it work? Type Char Write Block Write Char Read Block Read 1,102 92,703 Char ReWrite 47,441 Non RAID Linux RAID 0 Seeks/ Sec 5,207 143,020 349 1,156 191,821 90,145 4,191 229,218 423 Bonnie++ ver 1.06 results shown. Same computer, same OS (Linux 2.6.33, 64 bit). Similar hard drives used. Phenom II X6 CPU @ 3.6Ghz. As you can see, block reads and writes are much faster, and seek time is also faster.

But what if you want to set up RAID manually without using the distro installation tools? Then you need to boot onto a rescue Linux (CD/Flash) and use command line tools to partition and set up the RAID. It is quite a bit more complicated. Here is a great resource for Linux software RAID information: http://raid.wiki.kernel.org/

mdam Create: Create a new array with per-device superblocks (normal creation). Assemble: Assemble the parts of a previously created array into an active array. Typically you do this in the init scripts after rebooting. Follow or Monitor: Monitor one or more md devices and act on any state changes. This is only meaningful for raid1, 4, 5, 6, 10 or multipath arrays as only these have interesting state. raid0 or linear never have missing, spare, or failed drives, so there is nothing to monitor. Typically you do this after rebooting too. Build: Build an array that doesn't have per-device superblocks. For these sorts of arrays, mdadm cannot differentiate between initial creation and subsequent assembly of an array. It also cannot perform any checks that appropriate devices have been requested. Grow: Grow, shrink or otherwise reshape an array in some way. Changing the active size of component devices in RAID level 1/4/5/6 and changing the number of active devices in RAID1. Manage: This is for doing things to specific components of an array such as adding new spares and removing faulty devices.

As a side note: Hotswapping means the ability to add or subtract hard drives, on the fly, while the system is running. Newer motherboard SATA controller chipsets do support this (AHCI), and so does Linux! It works! Just remember that you should NEVER remove a running member of a RAID0 (striping only) array or you will instantly ruin the entire array... But for RAID1 & 5, this is an OK thing to do (with RAID 5, only ONE drive between rebuilds). SYBA CL-HD-MROF, SATA 3.5, Newegg, $20ea

Mark's RAID 0 + hotswap trayless racks