You are on page 1of 22

Searchforanythingonthissite...

(https://www.facebook.com/asparuh.polyovski) (http://homelabserver.com/?feed=rss2)
(http://www.linkedin.com/in/asparuhp)

MYTECHNOLOGYBLOG
(HTTP://HOMELABSERVER.COM/)
"StayHungry.StayFoolish."

SetupsoftwareRAID10onCentOS6.5at
insallationtime
April5,2014(http://homelabserver.com/?p=292) pooh(http://homelabserver.com/?author=1)
Disclaimer:Allcontentprovidedonthishomelabserver.comblogisforinformationalpurposesonly.Theowner
ofthisblogmakesnorepresentationsastotheaccuracyorcompletenessofanyinformationonthissiteor
foundbyfollowinganylinkonthissite.Theownerofhomelabserver.comwillnotbeliableforanyerrorsor
omissionsinthisinformationnorfortheavailabilityofthisinformation.Theownerwillnotbeliableforany
losses,injuries,ordamagesfromthedisplayoruseofthisinformation.Thistermsandconditionsissubjectto
changeatanytimewithorwithoutnotice.

IntroductiontotheRAIDtechnology
ThetermRAIDstandsforRedundantArrayofIndependentDisks.Itrepresentsastoragetechnologywhich
combinesmultiplediskdrivestoincreaseperformanceandincreasereliability.Therearethreetypesof
RAID:Hardware(controllercard),Integrated(FakeorpseudoRAIDprovidedbytheBIOSonthe
motherboardorsomelowendcards)andSoftware(OS).

NowadaystheSoftwareRAIDisacosteffective,flexibleandreliablealternativetotheHardwareRAIDfor
homeofficePCs,SMEsserversorevenfoundinsomecorporateexternalstoragesystems.Letspointout
thattheRAIDtechnologydoesnotreplacetheregularbackupstoanotherlocation.Inexampleavoltage

spikes,viruses,failuresordisastersstillcouldleadtocorruptedandunrecoverabledata.

RAID10isknownasastripeofmirrorsandcombinesthefeaturesofRAID0(striping)andRAID1
(mirroring).ItoutperformsRAID5intermsofreadandwriteoperations.
Thediagrambelowillustrateadistributionof8datablocks[A1,,A8]acrosseven(atleast4)equivalent
sizeddisks[Disk1,,Disk4].ThesizeoftheRAIDdeviceisequaltothetotalsizeforthehalf(inthis
particularcase2)ofthedisks.

LetsconfigureRAID10onCentOS6.5atinstall
IwillskipthewholeOSinstallationprocessstepsandwillsharejusttherelevantscreens.Themainideaisto
createcustomlayout,wherewewilldefine3partitionsforeachofthe4(x20GB)disksandcreatethe
correspondentsoftwareRAIDdevices:
/boot500MB(twicetheminimum)
swap2048MB(twicetheRAMsize)
/approx.35GB(therestoftheavailablespace)

Maybeitisagoodideatosplitthe35GBintotwoRAIDarraysonefortherootFSandanotherfordataor
performancebenchmarks.ButforsimplicityIwillleaveitasitis.


Clickonthe[Create]buttononthemainscreen>thenselectRAIDPartitionfromthedialogandclickthe
[Create]dialogbutton.

Wearegoingtocreateonebyone4bootpartitionsforsda,sdb,sdc,sdd.Ichoose500MB(experimentally
discoveredthatweneedtoadd1MB,whichisusedmostprobablyforsysteminformation).

Whendonewithall4partitionsclickagainonthe[Create]buttononthemainscreen.Thistimewehave4
availablepartitionandcancreateRAIDDeviceforthosepartitions.

Pleasemakesurethatweselectall4x501MBpartitions,/bootformountpointandRAID1forRAIDlevel(the
bootpartitioncannotbeinstalledonRAID10device).

Createanother4x2049MBpartitions,whichwillbeusedforswap.Why2049,butnot2048?Thepartitions
andsoftwareraiddevicesconsumessomeMBforsysteminformation.Ontheothersizewecanputonly
integersintheSize(MB)field.WhendoneclickoncreateinordertocreatetheswapRAIDdevice.Please

donotchosemountpoint,butratherselecttheswapasaFileSystemType,RAID10andallthesd*2
partitionscreatedearlier.

Create4partitions,onebyone,whichwillbeusedfortherootfilesystem.

CreatetheRAIDdevicebasedonthosepartitions.

ClickontheFormatbutton.

Writechanges.

Acceptthedefault.AftertheinstallationCentOSwillperformsyncandthebootloaderwillbereplicatedtothe
disks.

WellknownissueisthattheCentOSSoftwareRAIDwillnotloadGRUBon/dev/md0.Itcanbereproducedif
wechoose/dev/md0onthepreviousstepandthentheCentOSwontboot.Thereforeweneedtofixtheboot
loader:

1.UsingtheCentOSinstallmedia,boottotherescuemode
2.selectthestartshelloption
3.Enterthefollowingcommand:chroot/mnt/sysimage
4.ReinstallGRUB:grubinstall/dev/md0
5.Reboot

InCentOSrunApplications>SystemTools>DiskUtilityandreviewthelayoutorinarootconsolerunthe
palimpsestcommand.

Wehavevariousoptionstomonitorandcontrolthearray.

ThisarticlewaswrittenusingaVirtualbox,soIdontbelievethatanybenchmarkwillbeaccurate.Soletme
sharearealone,performedonAsusV8andCentOS6.5.

Idonthavesparenonraiddriveonthatmachineatthemoment,exceptToshibadiskinanexternalUSB3
enclosure.ButanywaythereadspeedsshouldbemuchslowerforaregularSATAdrive.

IntermsofadministrationwecouldrunaCLItoolcalledmdadm,whichisusedforbuilding,managing,and
monitoringLinuxmddevices(akaRAIDarrays).Moreinfocouldbefoundinthehelpandmanualpages.

mdadmhelp
manmdadm

[root@mbis1~]#cat/proc/mdstat
Personalities:[raid10][raid1]md0:activeraid1sda2[0]sdc2[2]sdb2[1]sdd2[3]526324blockssuper
1.0[4/4][UUUU]md2:activeraid10sda3[0]sdc3[2]sdb3[1]sdd3[3]908602368blockssuper1.1
512Kchunks2nearcopies[4/4][UUUU]bitmap:0/7pages[0KB],65536KBchunk
md1:activeraid10sdc1[2]sdd1[3]sdb1[1]sda1[0]67109888blockssuper1.1512Kchunks2near
copies[4/4][UUUU]unuseddevices:<none>

[root@mbis1~]#mdadmdetail/dev/md2
/dev/md2:
Version:1.1
CreationTime:FriMar2813:11:552014
RaidLevel:raid10
ArraySize:908602368(866.51GiB930.41GB)
UsedDevSize:454301184(433.26GiB465.20GB)
RaidDevices:4
TotalDevices:4
Persistence:Superblockispersistent
IntentBitmap:Internal
UpdateTime:FriApr414:45:542014
State:active
ActiveDevices:4
WorkingDevices:4
FailedDevices:0
SpareDevices:0
Layout:near=2
ChunkSize:512K
Name:mbis1:2(localtohostmbis1)
UUID:22c551dc:10867cba:79c354e6:6f0d2b70
Events:2765
NumberMajorMinorRaidDeviceState
0830activesync/dev/sda3
18191activesync/dev/sdb3
28352activesync/dev/sdc3
38513activesync/dev/sdd3

WecouldinstallanduseWebminasaGUI

#Installcd/opt
wgethttp://prdownloads.sourceforge.net/webadmin/webmin1.6801.noarch.rpm
(http://prdownloads.sourceforge.net/webadmin/webmin1.6801.noarch.rpm)
wgethttp://www.webmin.com/jcameronkey.asc(http://www.webmin.com/jcameron
key.asc)
rpmimportjcameronkey.asc
rpmUvhwebmin1.6701.noarch.rpm

#Manage/etc/init.d/webminstart
/etc/init.d/webminstop
/etc/init.d/webminrestart
/etc/init.d/webminstatus#Changethedefaultpasswordifneeded
/usr/libexec/webmin/changepass.pl/etc/webminrootsecretpassword#Changethe
defaultportifneededLogintoWebminasaroot>>Webmin>>Webmin
Configuration>>PortsandAddresses

AccesstheWebminfromaWebBrowserusingtherootuserandpassword,localhostorFQDNaddresand
thedefaultport10000:http://localhost:10000(http://localhost:10000/)>Hardware>LinuxRAID

TheWebminLinuxRAIDoptionisquiteuseful.

CONCLUSION
WehavesetupCentOS6.5systemwithasoftwareRAID10arrays.Whensomeonewantstoimprovethe
availability,reliabilityandtheflexibilityofhiscomputersystemthenRAID10isthewaytogo.Furtherstepwill
betolookforsolidstatedrivesinsteadoftheregularSATAdisks.Ifyouwanttoachievesomethingmore,then
youneedtolookforanotherRAIDlevelsanddifferentstoragetechnologies.Mypersonalopinionis
thatRAID10willfitmostoftheindividualorsmallandmediumcompanyneeds.

ThisentrywastaggedCentOS6.5(http://homelabserver.com/?tag=centos65),RAID
(http://homelabserver.com/?tag=raid),RAID10(http://homelabserver.com/?tag=raid10).Bookmarkthe
permalink(http://homelabserver.com/?p=292).

2thoughtsonSetupsoftwareRAID10onCentOS
6.5atinsallationtime

fengonJune30,2015(http://homelabserver.com/?p=292#comment235)
Excuteme,whatifoneofdiskbroken,andIaddanewonetoraid10array.HowcouldIrebuild
raid10array?DoIneedothertoolstodothis?
Reply(/?p=292&replytocom=235#respond)
poohonJuly21,2015(http://homelabserver.com/?p=292#comment256)
Thankyouforyourquestion,
TobehonestInevertriedthisandyouneedtotestitfirstcarefullyinadedicated
environment.Isuspectthatifwereplaceonediskwiththesamesizeandmodelthe
rebalancewillhappenautomatically.Ifnotthenweneedtousethemdadmutility.Iwilltryto
findtimetotestit,butatthemomentmyenvironmentisdestroyed.
Hereisalinktonicearticlewhichmightbehelpful(butpleasenotethatitisforRAID1)
https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array
(https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array)
Goodluck
Reply(/?p=292&replytocom=256#respond)

LeaveaReply
Youremailaddresswillnotbepublished.Requiredfieldsaremarked*
Name*

Email*

Website

Comment

YoumayusetheseHTML(HyperTextMarkupLanguage)tagsandattributes: <ahref=""title=""><abbr
title=""><acronymtitle=""><b><blockquotecite=""><cite><code><deldatetime=""><em><i><q
cite=""><s><strike><strong>

PostComment

2015CopyrightHOMELABSERVER.Allrightsreserved.

You might also like