Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
201 lines (172 sloc) 5.6 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Fun with LVM</title>
<!-- metadata -->
<meta name="version" content="S5 1.1" />
<meta name="presdate" content="2008?" />
<meta name="author" content="Jozef Kutej"/>
<meta name="company" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<!-- <meta name="defaultView" content="outline" /> -->
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<link rel="stylesheet" href="ui/default/slides.css" type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css" type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
<!-- S5 JS -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<!-- syntax highlighting -->
<link rel="stylesheet" type="text/css" href="ui/sh/sh_style.css" />
<script type="text/javascript" src="ui/sh/sh_main.js"></script>
<script type="text/javascript" src="ui/sh/sh_perl.js"></script>
<script type="text/javascript" src="ui/sh/sh_sql.js"></script>
</head>
<body><!-- onload='sh_highlightDocument();' -->
<div class="layout">
<div id="controls"><!-- DO NOT EDIT --></div>
<div id="currentSlide"><!-- DO NOT EDIT --></div>
<div id="header"></div>
<div id="footer">
<!-- added by Jozef :) -->
<div id="counter" style="float: right; margin-right: 10px;">15</div>
<span id="ignoreClicks" />
<h1>? 2007</h1>
<h2>Fun with RAID</h2>
</div>
</div>
<div class="presentation">
<div class="slide">
<h1>Fun with RAID</h1>
<h3>Jozef</h3>
<!-- <p><img src=''/></p> -->
</div>
<div class="slide">
<h1>RAID</h1>
<ul>
<li>apt-get install mdadm</li>
<li># dpkg-reconfigure mdadm</li>
</ul>
</div>
<div class="slide">
<h1>RAID</h1>
<h2>Redundant Array of Independent/Inexpensive Disks</h2>
<ul>
<li>RAID0 - striping<br/>n*SIZE</li>
<li>RAID1 - mirror<br/>SIZE</li>
<li>RAID5 - striped set with distributed parity<br/>(n-1)*SIZE</li>
<li>RAID6 - striped set with dual parity<br/>(n-2)*SIZE</li>
</ul>
</div>
<div class="slide">
<h1>software raid</h1>
<ul>
<li>more flexible</li>
<li>can be reconfigured "on the fly"</li>
<li>ex. pvmove data from RAID1 blockdevice,<br/>
destroy the RAID1 and use the disks to construct RAID0,
vgextend volume gropu with twice the size</li>
<li>ex.2 replacing disks for bigger ones</li>
<li>cat /proc/mdstat</li>
</ul>
</div>
<div class="slide">
<h1>server with 2 disks</h1>
<ul>
<li>/dev/hda1 + /dev/hdb1 = RAID1 =&gt; /boot</li>
<li>/dev/hda2 + /dev/hdb2 = RAID1 =&gt; /</li>
<li>/dev/hda3 + /dev/hdb3 = RAID0 =&gt; /data</li>
<li>redundacy for /boot and /, speed for data</li>
<li>in case of 1 disk failure system will survive<br/>
no need for reinstalation, data are lost but recovered from backup</li>
</ul>
</div>
<div class="slide">
<h1>server with 3 disks</h1>
<ul>
<li>
/dev/hda1 + /dev/hdb1 = RAID1 =&gt; /boot<br/>
/dev/hdc1 spare
</li>
<li>/dev/hda2 + /dev/hdb2 = RAID1 =&gt; /<br/>
/dev/hdc2 spare
</li>
<li>/dev/hda3 + /dev/hdb3 + /dev/hdc3 = RAID5 =&gt; /data</li>
<li>redundacy for /boot and /, speed+redundancy for data</li>
<li>server runs with no impact in case of 1 disk failure<br/>
if two disks fail (not at the same time) system is ok but /data lost</li>
</ul>
</div>
<div class="slide">
<h1>server with 8 disks</h1>
<ul>
<li>
/dev/sda + /dev/sdb = RAID1<br/>
/dev/sdc spare (3 disks)
</li>
<li>/dev/sdd + /dev/sde + /dev/sdf + /dev/sdg = RAID5 =&gt; /data<br/>
/dev/sdh spare (5 disks)
</li>
</ul>
</div>
<div class="slide">
<h1>destroy our lvm setup...</h1>
<ul>
<li>lvremove vg00/test1</li>
<li>vgremove vg00</li>
<li>pvremove /dev/hdb # /dev/hdd (wiped with badblocks)</li>
</ul>
</div>
<div class="slide">
<h1>create raid0</h1>
<ul>
<li>mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/hd[bd]</li>
<li>cat /proc/mdstat</li>
<li>fdisk -l /dev/md0</li>
<li>mkfs.ext3 /dev/md0</li>
<li>mount /dev/md0 /mnt</li>
<li>umount /mnt</li>
<li>mdadm --stop /dev/md0 --zero-superblock /dev/hd[bd]</li>
</ul>
</div>
<div class="slide">
<h1>create raid1</h1>
<ul>
<li>mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[bd] --spare-devices=1 /dev/hda5</li>
<li>fdisk -l /dev/md0</li>
<li>cat /proc/mdstat</li>
<li>mkfs.ext3 /dev/md0</li>
<li>mount /dev/md0 /mnt</li>
<li>mdadm --manage /dev/md0 --fail /dev/hdb --fail /dev/hda5</li>
<li>mdadm --remove /dev/md0 /dev/hdb /dev/hda5</li>
<li>dd if=/dev/zero of=/dev/hdb</li>
<li>dd if=/dev/zero of=/dev/hdd</li>
<li>mdadm --add /dev/md0 /dev/hdb /dev/hda5</li>
<li>umount /mnt</li>
<li>mdadm --stop /dev/md0 --zero-superblock /dev/hd[bd] /dev/hda5</li>
</ul>
</div>
<div class="slide">
<h1>notes</h1>
<ul>
<li>/dev/hda5 1310 1374 522081 fd Linux raid autodetect</li>
<li>take care when buying different hdd-s<br/>
80GB is not always 80*1024*1024*1024B<br/>
80GB is sametimes 80*1000*1000*1000B<br/>
The difference is 1920MB or 2_013_265_920B...
</li>
</ul>
</div>
<!-- <div class="slide" style="background: url('catalyst-tricks/view.jpg') right top no-repeat;"> -->
<div class="slide">
<h1>And that's it...</h1>
<h2>Questions?</h2>
<p style="text-align: center;"><img src="catalyst-tricks/questions.jpg" alt="" title=""></p>
</div>
</div>
</body>
</html>
Something went wrong with that request. Please try again.