<?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>Ta vie on s'en fout! &#187; RAID</title>
	<atom:link href="http://tavie.onsenfout.com/tag/raid/feed/" rel="self" type="application/rss+xml" />
	<link>http://tavie.onsenfout.com</link>
	<description>Mon bazar techno-miam</description>
	<lastBuildDate>Tue, 22 Nov 2011 11:06:05 +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>Diminuer et agrandir la taille d&#8217;un volume logique LVM2</title>
		<link>http://tavie.onsenfout.com/2010/03/05/diminuer-et-agrandir-la-taille-dun-volume-logique-lvm2/</link>
		<comments>http://tavie.onsenfout.com/2010/03/05/diminuer-et-agrandir-la-taille-dun-volume-logique-lvm2/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 12:58:47 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[vm]]></category>
		<category><![CDATA[volume logique]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=227</guid>
		<description><![CDATA[Testé sur Debian 5.0 Lenny Le problème: 5 disques en RAID5 et LVM2, 1 groupe de volumes /dev/gv1 et 6 volumes logiques /dev/gv1/vol01 à /dev/gv1/vol06 occupant tout l&#8217;espace disponible. Tous les volumes logiques sont formatés en ext3. L&#8217;espace commence à manquer sur le volume logique vol06 alors que le volume vol02 a plein d&#8217;espace libre. [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Testé sur Debian 5.0 Lenny</em></p>
<p>Le problème:</p>
<p>5 disques en RAID5 et LVM2, 1 groupe de volumes <strong>/dev/gv1</strong> et 6 volumes logiques <strong>/dev/gv1/vol01</strong> à <strong>/dev/gv1/vol06</strong> occupant tout l&#8217;espace disponible. Tous les volumes logiques sont formatés en ext3.</p>
<p>L&#8217;espace commence à manquer sur le volume logique vol06 alors que le volume vol02 a plein d&#8217;espace libre. J&#8217;ai donc pris 14Go sur vol02 pour agrandir vol06. La manip n&#8217;est pas très compliquée mais il vaut mieux prendre son temps si on ne veut pas perdre toutes ses données,  en général on ne veut pas. La première étape est donc une sauvegarde des volumes à modifier.<span id="more-227"></span></p>
<h3>Diminuer la taille du volume /dev/gv1/vol02</h3>
<p>ATTENTION: Diminuer un volume en deçà de l&#8217;espace occupé par les données conduit à la destruction du système de fichiers.</p>
<p>La taille actuelle du volume est d&#8217;environ 286Go, je veux la ramener à 272Go. On va commencer par réduire la taille du système de fichiers à 270Go, puis réduire la taille du volume logique à 272Go et enfin agrandir le système de fichier à 272Go. Cette astuce donnée par <a href="http://doc.ubuntu-fr.org/utilisateurs/hoper" target="_blank">Hoper</a> dans <a href="http://doc.ubuntu-fr.org/lvm" target="_blank">cet article</a> permet de limiter les risques d&#8217;erreurs.</p>
<p>Démontage du volume :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02</pre></div></div>

<p>Vérification :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">e2fsck <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02</pre></div></div>

<p>Ramener la taille du système de fichiers à 270Go :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">resize2fs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02 270G</pre></div></div>

<p>Ramener la taille du volume logique à 272Go :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">lvresize <span style="color: #660033;">-L</span> 272G <span style="color: #660033;">-v</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02</pre></div></div>

<p>Etendre le système de fichiers pour qu&#8217;il occupe tout le volume logique :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">resize2fs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02</pre></div></div>

<p>Vérification :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">e2fsck <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02</pre></div></div>

<p>Remontage des volumes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol02</pre></div></div>

<p>Ca y est, le plus risqué est fait!</p>
<h3>Agrandir le volume /dev/gv1/vol06</h3>
<p>On va agrandir le volume logique vol06 pour qu&#8217;il récupère tout l&#8217;espace disponible dans le groupe de volume gv1.</p>
<p>On vérifie l&#8217;espace disponible avec vgdisplay :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vgdisplay</pre></div></div>

<p>Les infos intéressantes sont PE size et Free PE, j&#8217;obtiens :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">PE Size               <span style="color: #000000;">4</span>,00 MB
Free  PE <span style="color: #000000; font-weight: bold;">/</span> Size       <span style="color: #000000;">3700</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">14</span>,<span style="color: #000000;">45</span> GB</pre></div></div>

<p>La valeur de 14,45GB étant un arrondi, on va recalculer l&#8217;espace réellement disponible en Mo : <strong>3700&#215;4=14800Mo</strong></p>
<p>OK, on peut y aller.</p>
<p>Démontage du volume :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol06</pre></div></div>

<p>Vérification :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">e2fsck <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol06</pre></div></div>

<p>Agrandir de 14800Mo la taille du volume logique</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">lvresize <span style="color: #660033;">-L</span> +14800M <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol06</pre></div></div>

<p>Etendre le système de fichiers pour qu&#8217;il occupe tout le volume logique :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">resize2fs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol06</pre></div></div>

<p>Vérification :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">e2fsck <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol06</pre></div></div>

<p>Remontage des volumes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>gv1<span style="color: #000000; font-weight: bold;">/</span>vol06</pre></div></div>

<p>Ayé c&#8217;est fini.<br />
<strong>Liens:</strong><br />
<a href="http://doc.ubuntu-fr.org/lvm" target="_blank">LVM, une autre manière de partitionner</a></p>
<p>RAID et LVM</p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2010/03/05/diminuer-et-agrandir-la-taille-dun-volume-logique-lvm2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copier la table des partitions d&#8217;un disque vers un autre disque</title>
		<link>http://tavie.onsenfout.com/2009/04/30/copier-la-table-des-partitions-dun-disque-vers-un-autre-disque/</link>
		<comments>http://tavie.onsenfout.com/2009/04/30/copier-la-table-des-partitions-dun-disque-vers-un-autre-disque/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 11:52:45 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[partitionnement]]></category>
		<category><![CDATA[partitions]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[sfdisk]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=152</guid>
		<description><![CDATA[Testé sur Debian 5.0 Lenny La commande sfdisk permet de manipuler les tables de partitions et de dupliquer très simplement la structure de cette table d&#8217;un disque vers un autre. Si on veut copier la table des partitions du disque /dev/sda vers le disque /dev/sdb la commande sera : sfdisk -d /dev/sda &#124; sfdisk /dev/sdb [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: x-small;"><em>Testé sur Debian 5.0 Lenny<br />
</em></span></p>
<p>La commande sfdisk permet de manipuler les tables de partitions et de dupliquer très simplement la structure de cette table d&#8217;un disque vers un autre. Si on veut copier la table des partitions du disque /dev/sda vers le disque /dev/sdb la commande sera :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sfdisk <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #000000; font-weight: bold;">|</span> sfdisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb</pre></div></div>

<p>C&#8217;est très pratique si on veut initialiser un volume RAID 1 par exemple.</p>
<p>Attention quand même, comme toutes les commandes de bas niveau qui agissent sur la table des partitions, une mauvaise manip peut avoit des conséquences douloureuses. Mieux vaut réfléchir un brin avant d&#8217;appuyer sur Entrée&#8230;</p>
<p>Lien : <a title="Man page sfdisk" href="http://www.delafond.org/traducmanfr/man/man8/sfdisk.8.html" target="_blank">La man page de sfdisk</a>, très bien faite, qui indique les options de sauvegarde et restauration</p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2009/04/30/copier-la-table-des-partitions-dun-disque-vers-un-autre-disque/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supprimer un volume RAID logiciel sous debian / ubuntu</title>
		<link>http://tavie.onsenfout.com/2009/02/19/supprimer-un-volume-raid-logiciel-sous-debian/</link>
		<comments>http://tavie.onsenfout.com/2009/02/19/supprimer-un-volume-raid-logiciel-sous-debian/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 15:19:54 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[partitions]]></category>
		<category><![CDATA[RAID]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=126</guid>
		<description><![CDATA[testé sous Debian 5.0 Lenny AMD64 J&#8217;ai eu quelques soucis dernièrement à supprimer un volume RAID logiciel (RAID 1) que j&#8217;avais créé un peu précipitamment. A chaque redémarrage le volume RAID était rechargé. Voilà comment j&#8217;ai résolu le problème : Volume RAID1 : /dev/md1 Partitions du RAID : /dev/sda3 et /dev/sdb3 on démonte le volume [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>testé sous Debian 5.0 Lenny AMD64</em></p>
<p>J&#8217;ai eu quelques soucis dernièrement à supprimer un volume RAID logiciel (RAID 1) que j&#8217;avais créé un peu précipitamment. A chaque redémarrage le volume RAID était rechargé. Voilà comment j&#8217;ai résolu le problème :</p>
<p>Volume RAID1 : /dev/md1<br />
Partitions du RAID : /dev/sda3 et /dev/sdb3</p>
<p>on démonte le volume RAID :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1</pre></div></div>

<p>on désactive le volume :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> mdadm <span style="color: #660033;">-S</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md1</pre></div></div>

<p>Et on finit par les commandes magiques d&#8217;effaçage des superblocks pour ne pas voir revenir son RAID au boot suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> mdadm <span style="color: #660033;">--zero-superblock</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda3
<span style="color: #c20cb9; font-weight: bold;">sudo</span> mdadm <span style="color: #660033;">--zero-superblock</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb3</pre></div></div>

<p>Il faut aussi penser à modifier /etc/fstab en conséquence</p>
<p>Lien : <a title="How to disable/uninstall software raid-1 using mdadm?" href="http://ubuntuforums.org/showthread.php?t=394281" target="_blank">La soluce en anglais</a></p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2009/02/19/supprimer-un-volume-raid-logiciel-sous-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

