RAID sync

V13 v13 at v13.gr
Sat Jul 12 17:05:26 EEST 2008


On Friday 11 July 2008, Antonis Christofides wrote:
> Υποθέτουμε ότι φτιάχνω ένα Linux software RAID5, φτιάχνω filesystem
> εκεί πάνω, γράφω και αρχεία (π.χ. εγκαθιστώ λειτουργικό), και επειδή

Mias kai thiksame to olo thema, akoloythoyn kapoies prosopikes symboyles:

Gia polloys kai diaforoys logoys (merikoys toys anafero) proteino anepyfilakta 
tin eksis taktiki gia RAID5:

* Exoyme N syskeves se RAID5. Panta skeytomaste san na prokeitai na exoyme M 
(opoy M>N) syskeves sto mellon.
* Oi anagkes se xoro allazoyn. Einai protimotero na yparxei LVM pano apo RAID5 
kai na katanemetai o xoros me thn eykolia toy LVM.
* Ean exoyme N diskoys idioy megethoys SZ protimame na toys xorisoyme se 
komatia megethoys SZ2 << SZ. P.x. einai boliko na toys xorizoyme toys diskoys 
se partitions ton 50GB (to poly (?)) kai na ftiaxnoyme polla MD devices me 
ena apo ta mikra ayta partitions to kathena.
* Protimame na exoyme akribos to idio configuration se oloys toys diskoys 
(p.x. akribos ta idia partitions)
* To /boot mpainei ypoxreotika apeytheias se RAID1 me toylaxiston 2 devices.
* Apenergopoihoyme th write cache apo to to /etc/hdparm.conf gia oloys toys 
diskoys by-default kai thn energopoioyme mono ekei poy theloyme (praktika 
poythena)
* Prosthetoyme to grub se oloys toys diskoys

Me ta parapano:
* Kapoia stigmi sto melon tha baloyme eykola neoys diskoys
* Tha mporesoyme na ftiaksoyme nea paritions h na kanoyme resize otidipote 
exoyme idi on-the-fly
* Oles tis fores poy tha symbei kati (p.x. kernel panic, diakopi reymatos klp 
klp) kai tha xreiastei resync tha leme ti kala poy kaname kai exoyme mikra MD 
devices ta opoia den theloyn 150 xronia gia na ginoyn resync.

Etsi, me 4 diskoys ton 200GB xorismenoys se peripoy 4 partitions ton 50GB to 
kathena tha exoyme:
sda1, sdb1, sdc1, sdd1: RAID1 /boot (100MB?)
sda5, sdb5, sdc5, sdd5: RAID5 /dev/md5 (4x50GB = 150GB ofelima)
sda6, sdb6, sdc6, sdd6: RAID5 /dev/md6 (4x50GB = 150GB ofelima)
sda7, sdb7, sdc7, sdd7: RAID5 /dev/md7 (4x50GB = 150GB ofelima)
sda8, sdb8, sdc8, sdd8: RAID5 /dev/md8 (4x50GB = 150GB ofelima)

md5, md6, md7, md8: ginontai physical volumes (man pvcreate) gia LVM kai 
mpainoyn se ena volume group (esto VG1) (man vgcreate)

VG1: xorizetai se oti partitions (logical volumes) (man lvcreate) theloyme 
xoris na einai aparaitito na mirastei olos o xoros. Otidipote ginei mporei na 
allaksei on-the-fly sto mellon.

lv-root: 20GB
lv-home: 100GB
lv-whatever: XGB

Ean sto melon doyme oti to lv-home xreiazetia xoro kanoyme resize to lv-home 
(man lvresize) kai meta to filesystem poy einai mesa se ayto (man 
xfs_growfs). Kati tetoio xreiazetai peripoy 15 deyterolepta. To filesystem 
poy exo dokimasei kai doylevei 100% einai to XFS (den thelei oyte umoun), 
alla nomizo oti kai ta ypoloipa to kanoyn ayto.

Ean sto melon valoyme allon ena disko, tote:
* Ton xorizoyme se 4+1 partitions (man cfdisk)
* Kanoyme reshape ta 4 MD devices prosthetontas ta extra GB xoroy se ayta (man 
mdadm -> grow)
* Kanoyme resize to VG1 emesa kanontas resize ta PVs poy to apoteloyn (man 
pvresize)
* Prosthetoyme oti xoro theloyme sta LV poy theloyme opos anaferthike 
parapano.

To simantiko ths ypothesis den einai to oti h oli diadikasia ginetai ligo pio 
polyploki alla to oti 
* Den tha mas peiraksei ean xtypisei ena diskos (opoios to exei pathei kserei 
ti simainei ayto)
* Einai scallable
* Exei polles dynatotites gia prosarmogi se mellontikes anagkes
* Mporei na aksithei h taxytita toy oloy systimatos prosthetontas apla diskoys

To mono kako einai oti me lvm pano se RAID5 fainetai to overhead na pigainei 
akribos *2 kai na exeis pleon problimata kai me alles taxytites, opos p.x. 
mnimi:

# dd if=/dev/mapper/lvm12-vm of=/dev/null bs=10240000 count=100
1024000000 bytes (1.0 GB) copied, 20.4277 s, 50.1 MB/s

# dd if=/dev/md/6 of=/dev/null bs=10240000 count=100
1024000000 bytes (1.0 GB) copied, 9.45354 s, 108 MB/s

Sth proti periptosi oi diskoi kathontai eno sth deyteri den kathontai.

P.x, des ena mixanima me 12 diskoys se software RAID5:

# dd if=/dev/md10 of=/dev/zero bs=10240000 count=100 skip=200
1024000000 bytes (1.0 GB) copied, 5.78516 seconds, 177 MB/s

Opos blepeis h taxytita periorizetai para poly. Me to iostat fainetai oti oi 
diskoi diabazoyn me 14MB/sec eno o kathenas ksexorista petyxainei:

# dd if=/dev/sdd of=/dev/zero bs=10240000 count=100 skip=1000
1024000000 bytes (1.0 GB) copied, 15.7666 seconds, 64.9 MB/s

Fysika, logo toy oti oi perissoteres anagnoseis den einai seiriakes, ta 
parapano den einai sobaro problima kai h ayksisi tis taxytitas paei sxedon 
gramika.

<<V13>>
 
P.s. Oraio howto: http://scotgate.org/?p=107




More information about the Linux-greek-users mailing list