<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Werk &#187; fdisk</title>
	<atom:link href="http://werk.feub.net/tag/fdisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://werk.feub.net</link>
	<description>Pourquoi Werk? ^.^</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:18:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Modification du schéma de partitionnement d&#8217;edoras</title>
		<link>http://werk.feub.net/2009/01/modification-du-schema-de-partitionnement-dedoras/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=modification-du-schema-de-partitionnement-dedoras</link>
		<comments>http://werk.feub.net/2009/01/modification-du-schema-de-partitionnement-dedoras/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 18:23:45 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[3615 tavie]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid1]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=6</guid>
		<description><![CDATA[Passage en full LVM]]></description>
			<content:encoded><![CDATA[<p>
Cette opération est lourde et longue, mais j&#8217;ai décidé de modifier le partitionnement de mon petit serveur edoras actuellement sous <a href="http://www.fedora-fr.org/" title="Fedora France">Fedora 10</a>.<br />
En effet, depuis de nombreuses années, j&#8217;utilisais un partitionnement <em>classique</em>, et depuis <a href="http://docs.fedoraproject.org/release-notes/f10/fr/" title="Fedora">Cambridge</a>, je suis passé à <a href="http://fr.wikipedia.org/wiki/LVM" title="Wikipedia">LVM</a> (enfin!) et même au <a href="http://feub.net/werk/index.php/tic/commentaires/gerer_une_pile_raid_et_lvm_sous_fedora_10/" title="feub.net">RAID 1</a> pour encore plus sécuriser mes sauvegardes photos. Le RAID a été ajouté avec deux disques non utilisés, mais il me restait deux autres disques avec une seule partition chacun <em>sdb1</em> et <em>sdc1</em> bourrés de données et montés de façon classique, respectivement en /data1 (200Go) et /backup (160Go), ces deux partitions étant utilisés en montages <a href="http://fr.wikipedia.org/wiki/Network_File_System" title="Wikipedia">NFS</a> sur mon réseau (et TRES solicités).
</p>
<p>
<em>Avant :</em>
</p>
<pre lang=bash">
$ df -h
Sys. de fich.         Tail. Occ. Disp. %Occ. Monté sur
/dev/mapper/VG1-LVroot
9,9G  3,7G  5,7G  40% /
/dev/mapper/VG1-LVhome
26G  853M   23G   4% /home
/dev/sdc1             145G   83G   54G  61% /backup
/dev/sdb1             184G  111G   64G  64% /data1
/dev/sda1             236M   29M  195M  13% /boot
/dev/mapper/VGraid-LVraid
459G  216G  220G  50% /raid
</pre>
<p>
D&#8217;une part, cela me faisait beaucoup de montages (NFS) sur mes Mac alors que je pouvais &#8211; théoriquement &#8211; rassembler /backup et /data1 en un seul volume, et d&#8217;autre part, je désirais passer en full LVM pour plus de flexibilité.
</p>
<p>
La limitation des systèmes de fichiers classiques m&#8217;imposait d&#8217;avoir ces deux partitions séparées, celles-ci étant sur deux disques différents. C&#8217;est là que LVM montre sa puissance : la possibilité de créer un groupe de volumes sur les deux disques, soit au final avoir une seule partition <em>virtuelle</em> de 360Go unique sur les deux disques.
</p>
<p>
<em>Après :</em>
</p>
<pre lang=bash">
$ df -h
Sys. de fich.         Tail. Occ. Disp. %Occ. Monté sur
/dev/mapper/VG1-LVroot
9,9G  3,7G  5,7G  40% /
/dev/mapper/VG1-LVhome
26G  855M   23G   4% /home
/dev/mapper/VGdata-LVdata
331G  1,8G  312G   1% /mnt/data
/dev/sda1             236M   29M  195M  13% /boot
/dev/mapper/VGraid-LVraid
459G  275G  162G  63% /mnt/raid
</pre>
<p>
Après avoir déplacé mes données sur un autre disque pour faire la modification, redéfini <em>sdb1</em> et <em>sdc1</em> en partition de type 8e (Linux LVM) dans <a href="http://fr.wikipedia.org/wiki/Fdisk" title="Wikipedia">fdisk</a>, j&#8217;ai opéré comme suit pour ajouter un groupe de volumes VGdata contenant un unique volume logique LVdata de la totalité de l&#8217;espace disponible (je ne détaillerai pas, les étapes ayant été un peu mieux expliquées dans <a href="http://feub.net/werk/index.php/tic/commentaires/gerer_une_pile_raid_et_lvm_sous_fedora_10/" title="feub.net">ce billet</a>) :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># pvcreate /dev/sdb1</span>
<span style="color: #666666; font-style: italic;"># pvcreate /dev/sdc1</span>
<span style="color: #666666; font-style: italic;"># vgcreate -s 16M VGdata /dev/sdb1 /dev/sdc1</span>
<span style="color: #666666; font-style: italic;"># lvcreate -l 21462 VGdata -n LVdata</span>
<span style="color: #666666; font-style: italic;"># mkfs.ext3 /dev/VGdata/LVdata</span>
<span style="color: #666666; font-style: italic;"># mkdir /mnt/data</span>
<span style="color: #666666; font-style: italic;"># mount /dev/VGdata/LVdata /mnt/data</span></pre></div></div>

<p>
Ajout du montage dans <a href="http://fr.wikipedia.org/wiki/Fstab" title="Wikipedia">fstab</a> :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>VGdata<span style="color: #000000; font-weight: bold;">/</span>LVdata	<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>data		ext3	defaults	<span style="color: #000000;">1</span> <span style="color: #000000;">2</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2009/01/modification-du-schema-de-partitionnement-dedoras/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gérer une pile RAID et LVM sous Fedora 10</title>
		<link>http://werk.feub.net/2008/12/gerer-une-pile-raid-et-lvm-sous-fedora-10/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gerer-une-pile-raid-et-lvm-sous-fedora-10</link>
		<comments>http://werk.feub.net/2008/12/gerer-une-pile-raid-et-lvm-sous-fedora-10/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 07:01:21 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=8</guid>
		<description><![CDATA[Sécuriser ses données avec du RAID logiciel]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://fr.wikipedia.org/wiki/RAID_(informatique)" title="Wikipedia">RAID</a> est l&#8217;acronyme pour Redundant Array of Inexpensive Disks, c&#8217;est-à-dire &laquo;&nbsp;<em>Matrice Redondante de Disques peu Onéreux</em>&laquo;&nbsp;. Il s&#8217;agit d&#8217;une technologie utilisant plusieurs disques durs pour stocker des données afin de les sécuriser, ces données étant copiées sur tous les disques (de façons différentes suivant la configuration RAID utilisée : 1, 5, 1+0, 0+1, 6, etc), en cas de panne d&#8217;un disque, la machine reste opérationnelle et les données sont toujours accessibles. Avec certains pré-requis, il est même possible de changer le disque défaillant à chaud sans arrêter la machine, la couche RAID se chargeant de la reconstruction (synchronisation) des données.<br />
Il existe également le RAID 0, mais qui diffère des autres RAID dans son fonctionnement.
</p>
<p>
Cet article parle du <a href="http://fr.wikipedia.org/wiki/RAID_(informatique)#Le_RAID_logiciel" title="Wikipedia">RAID logiciel</a>, sur une machine en <a href="http://www.fedora-fr.org/" title="Fedora France">Fedora 10</a>.
</p>
<p><span id="more-8"></span></p>
<h4>Mise en place d&#8217;un RAID 1 logiciel</h4>
<p>
Je dispose de deux disques SATA 500Go que je désire utiliser en RAID 1, celui-ci fonctionne avec 2 disques (ou plus). Il s&#8217;agit d&#8217;une <em>simple</em> copie des données d&#8217;un disque sur l&#8217;autre, de façon transparente. Après avoir installé ces deux disques, je vérifie qu&#8217;ils soient reconnus par le système :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sd<span style="color: #000000; font-weight: bold;">*</span>
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>,  <span style="color: #000000;">0</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>,  <span style="color: #000000;">1</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>,  <span style="color: #000000;">2</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda2
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>,  <span style="color: #000000;">3</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda3
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>, <span style="color: #000000;">16</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>, <span style="color: #000000;">17</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>, <span style="color: #000000;">32</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdc
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>, <span style="color: #000000;">33</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdc1
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>, <span style="color: #000000;">48</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdd
brw-rw---- <span style="color: #000000;">1</span> root disk <span style="color: #000000;">8</span>, <span style="color: #000000;">64</span> déc. <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">37</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sde</pre></div></div>

<p>
Il faut maintenant créer une partition physique sur ces disques et placer l&#8217;identificateur de ces partitions comme étant de type <em>Linux RAID</em>, ceci avec <a href="http://fr.wikipedia.org/wiki/Fdisk" title="Wikipedia">fdisk</a> :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># fdisk /dev/sdd</span>
Puis taper ces commandes pour un disque neuf :
n
p
<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">&amp;</span>lt;entrée<span style="color: #000000; font-weight: bold;">&amp;</span>gt;
<span style="color: #000000; font-weight: bold;">&amp;</span>lt;entrée<span style="color: #000000; font-weight: bold;">&amp;</span>gt;
t
fd
<span style="color: #c20cb9; font-weight: bold;">w</span></pre></div></div>

<p>
Faire de même pour le deuxième disque. Au final un <code>fdisk -l</code> devrait donner quelque chose comme ça :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Disque <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdd: <span style="color: #000000;">500.1</span> Go, <span style="color: #000000;">500107862016</span> octets
<span style="color: #000000;">255</span> heads, <span style="color: #000000;">63</span> sectors<span style="color: #000000; font-weight: bold;">/</span>track, <span style="color: #000000;">60801</span> cylinders
Units = cylindres of <span style="color: #000000;">16065</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">512</span> = <span style="color: #000000;">8225280</span> bytes
Disk identifier: 0x000b9726
Périphérique Amorce    Début         Fin      Blocs    Id  Système
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdd1               <span style="color: #000000;">1</span>       <span style="color: #000000;">60801</span>   <span style="color: #000000;">488384001</span>   fd  Linux raid autodetect
Disque <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sde: <span style="color: #000000;">500.1</span> Go, <span style="color: #000000;">500107862016</span> octets
<span style="color: #000000;">255</span> heads, <span style="color: #000000;">63</span> sectors<span style="color: #000000; font-weight: bold;">/</span>track, <span style="color: #000000;">60801</span> cylinders
Units = cylindres of <span style="color: #000000;">16065</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">512</span> = <span style="color: #000000;">8225280</span> bytes
Disk identifier: 0x000b9726
Périphérique Amorce    Début         Fin      Blocs    Id  Système
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sde1               <span style="color: #000000;">1</span>       <span style="color: #000000;">60801</span>   <span style="color: #000000;">488384001</span>   fd  Linux raid autodetect</pre></div></div>

<p>
Il est temps de combiner ces deux disques en une seule unité RAID 1, ceci par l&#8217;intermédiaire de la commande à tout faire <a href="http://linux.die.net/man/8/mdadm" title="linux.die.net">mdadm</a> :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1</span></pre></div></div>

<p>
La syntaxe est assez explicite : création d&#8217;une pile RAID qui sera en <code>md0</code>, de niveau 1 utilisant les 2 disques préparés auparavent. Et voilà, le RAID 1 est crée! Petite vérification :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mdadm --detail /dev/md0</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0:
Version : <span style="color: #000000;">0.90</span>
Creation Time : Sun Dec <span style="color: #000000;">28</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">24</span>:<span style="color: #000000;">39</span> <span style="color: #000000;">2008</span>
Raid Level : raid1
Array Size : <span style="color: #000000;">488383936</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">465.76</span> GiB <span style="color: #000000;">500.11</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Used Dev Size : <span style="color: #000000;">488383936</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">465.76</span> GiB <span style="color: #000000;">500.11</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Raid Devices : <span style="color: #000000;">2</span>
Total Devices : <span style="color: #000000;">2</span>
Preferred Minor : <span style="color: #000000;">0</span>
Persistence : Superblock is persistent
Update Time : Mon Dec <span style="color: #000000;">29</span> 08:<span style="color: #000000;">33</span>:06 <span style="color: #000000;">2008</span>
State : clean
Active Devices : <span style="color: #000000;">2</span>
Working Devices : <span style="color: #000000;">2</span>
Failed Devices : <span style="color: #000000;">0</span>
Spare Devices : <span style="color: #000000;">0</span>
UUID : d6b46a36:85a45c5f:5232c6b9:3d8a986e
Events : <span style="color: #000000;">0.8</span>
Number   Major   Minor   RaidDevice State
<span style="color: #000000;">0</span>       <span style="color: #000000;">8</span>       <span style="color: #000000;">49</span>        <span style="color: #000000;">0</span>      active <span style="color: #c20cb9; font-weight: bold;">sync</span>   <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdd1
<span style="color: #000000;">1</span>       <span style="color: #000000;">8</span>       <span style="color: #000000;">65</span>        <span style="color: #000000;">1</span>      active <span style="color: #c20cb9; font-weight: bold;">sync</span>   <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sde1</pre></div></div>

<p>
Si la ligne <code>State</code> rapporte bien <code>clean</code>, alors tout est en principe bon.
</p>
<h4>LVM sur le RAID</h4>
<p>
Le RAID fonctionne, il faut maintenant l&#8217;utiliser. Nous allons gérer <code>md0</code> avec <a href="http://fr.wikipedia.org/wiki/LVM" title="Wikipedia">LVM</a>, en commencant par créer un volume physique, ce qui va initilaiser <code>md0</code> pour utiliser LVM :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># pvcreate /dev/md0</span></pre></div></div>

<p>
Ensuite, il faut créer le volume groupe, que j&#8217;appelle <strong>VGraid</strong>. La valeur par défaut du PE (Physical Extent) peut se révéler trop faible pour une grosse matrice RAID. Il est alors possible d&#8217;indiquer une taille de PE plus importante avec l&#8217;option -s. Leur nombre maximal est approximativement de 65000 et leur taille par défaut de 4Mo, partant delà, il faut prendre la taille du volume et de le diviser par 65000, puis de l&#8217;arrondir à l&#8217;entier significatif le plus grand le plus proche. Par exemple, pour un volume RAID de 500Go, grosso-modo 500000Mo cela donne : 500000 / 65000 = 7,69, soit 8Mo. Je vais le mettre à 32 pour être plus à l&#8217;aise.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vgcreate -s 16M VGraid /dev/md0</span></pre></div></div>

<p>
Le VG est désormais crée, il faut maintenant le remplir avec un ou plusieurs volume(s) logique(s). Je vais en ajouter un seul &#8211; <strong>LVraid</strong> &#8211; qui prendra la taille du VG. Pour connaître cette taille en PE :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vgdisplay VGraid</span>
<span style="color: #660033;">---</span> Volume group <span style="color: #660033;">---</span>
VG Name               VGraid
System ID
Format                lvm2
Metadata Areas        <span style="color: #000000;">1</span>
Metadata Sequence No  <span style="color: #000000;">2</span>
VG Access             read<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">write</span>
VG Status             resizable
MAX LV                <span style="color: #000000;">0</span>
Cur LV                <span style="color: #000000;">1</span>
Open LV               <span style="color: #000000;">1</span>
Max PV                <span style="color: #000000;">0</span>
Cur PV                <span style="color: #000000;">1</span>
Act PV                <span style="color: #000000;">1</span>
VG Size               <span style="color: #000000;">465</span>,<span style="color: #000000;">75</span> GB
PE Size               <span style="color: #000000;">32</span>,00 MB
Total PE              <span style="color: #000000;">14904</span>
Alloc PE <span style="color: #000000; font-weight: bold;">/</span> Size       <span style="color: #000000;">14904</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">465</span>,<span style="color: #000000;">75</span> GB
Free  PE <span style="color: #000000; font-weight: bold;">/</span> Size       <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">0</span>
VG UUID               D33fbC-w82v-I83g-TAgG-vZaA-8C52-1aVEfr</pre></div></div>

<p>
Et pour le créer :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># lvcreate -l 14904 VGraid -n LVraid</span></pre></div></div>

<p>
Ceci fait, <code>/dev/VGraid/LVraid</code> (également mappé sous <code>/dev/mapper/VGraid-LVraid</code>) peut être utilisé comme une partition &laquo;&nbsp;normale&nbsp;&raquo;, donc on formate et on monte normalement :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mkfs.ext3 /dev/VGraid/LVraid</span>
<span style="color: #666666; font-style: italic;"># mkdir /mnt/raid</span>
<span style="color: #666666; font-style: italic;"># mount /dev/VGraid/LVraid /mnt/raid</span></pre></div></div>

<p>
Notre filesystem est prêt à l&#8217;emploi et les données présentes dessus seront mirrorées. Pour connaître l&#8217;état de la pile RAID :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cat /proc/mdstat</span>
Personalities : <span style="color: #7a0874; font-weight: bold;">&#91;</span>raid1<span style="color: #7a0874; font-weight: bold;">&#93;</span>
md0 : active raid1 sdd1<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> sde1<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000;">488383936</span> blocks <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>UU<span style="color: #7a0874; font-weight: bold;">&#93;</span>
unused devices: <span style="color: #000000; font-weight: bold;">&lt;</span>none<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>
On voit qu&#8217;il est actif. [UU] désigne que les deux disques sont OK. En cas de problème sur un disque, cette info ressemblerait à [_U] ou [U_] suivant le disque défaillant.<br />
Il est également possible de surveiller sa matrice et d&#8217;être avertit par email en cas de panne par cette commande :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mdadm --monitor --mail=root@localhost --delay=1800 /dev/md0 &amp;</span></pre></div></div>

<p>
A noter que <code>--monitor</code> peut même aller plus loin et lancer un programme ou un script au lieu d&#8217;un simple email.</p>
]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2008/12/gerer-une-pile-raid-et-lvm-sous-fedora-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc (Feed is rejected)
Page Caching using apc
Object Caching 256/280 objects using memcached

Served from: werk.feub.net @ 2012-02-09 00:23:26 -->
