<?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; système</title>
	<atom:link href="http://tavie.onsenfout.com/tag/systeme/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>Démonter les partages Samba avant l&#8217;arrêt du système</title>
		<link>http://tavie.onsenfout.com/2009/10/07/demonter-les-partages-samba-avant-larret-du-systeme/</link>
		<comments>http://tavie.onsenfout.com/2009/10/07/demonter-les-partages-samba-avant-larret-du-systeme/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 10:41:34 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[cifs]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[réseau]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[système]]></category>
		<category><![CDATA[unmount]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=188</guid>
		<description><![CDATA[Testé avec Kubuntu 9.04 C&#8217;est un problème qui m&#8217;arrive souvent lorsque je monte des partages Samba au démarrage par /etc/fstab A l&#8217;arrêt ou au redémarrage de la machine, le système reste bloqué sur des messages de ce genre : CIFS VFS : No response for cmd 50 mid xxxxx Je n&#8217;ai pas de certitude, mais [...]<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[<address>Testé avec Kubuntu 9.04</address>
<p>C&#8217;est un problème qui m&#8217;arrive souvent lorsque je monte des partages Samba au démarrage par /etc/fstab</p>
<p>A l&#8217;arrêt ou au redémarrage de la machine, le système reste bloqué sur des messages de ce genre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">CIFS VFS : No response <span style="color: #000000; font-weight: bold;">for</span> cmd <span style="color: #000000;">50</span> mid xxxxx</pre></div></div>

<p>Je n&#8217;ai pas de certitude, mais le problème vient probablement du fait que le démontage des partages essaie de se faire alors que le réseau n&#8217;est plus disponible.<span id="more-188"></span></p>
<p>La solution est de forcer le démontage plus tôt dans les actions d&#8217;arrêt du système. Pour ça il faut créer des liens symboliques vers le script /etc/init.d/umountnfs.sh (qui démonte tous les partages réseau) dans les <a href="https://secure.wikimedia.org/wikipedia/fr/wiki/Runlevel">niveaux d&#8217;exécution</a> 0 (arrêt) et 6 (reboot) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>umountnfs.sh <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc0.d<span style="color: #000000; font-weight: bold;">/</span>K15umountnfs.sh
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>umountnfs.sh <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc6.d<span style="color: #000000; font-weight: bold;">/</span>K15umountnfs.sh</pre></div></div>

<p>J&#8217;utilise une priorité de 15 qui fonctionne bien avec mes configs, mais selon les services installés il sera peut-être nécessaire de modifier cette valeur.</p>
<p>Cette manip fonctionne avec Ubuntu et Debian, et sans doute avec les distributions qui ont un système d&#8217;init basé sur <a href="https://secure.wikimedia.org/wikipedia/fr/wiki/System_V" target="_blank">System V</a>.</p>
<p>Liens :</p>
<p><a href="http://whereofwecannotspeak.wordpress.com/2007/12/25/unmount-samba-filesystems-before-shutdown-or-reboot/" target="_blank">http://whereofwecannotspeak.wordpress.com/2007/12/25/unmount-samba-filesystems-before-shutdown-or-reboot/</a></p>
<p><a href="http://ubuntuforums.org/showthread.php?t=293513" target="_blank">http://ubuntuforums.org/showthread.php?t=293513</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/10/07/demonter-les-partages-samba-avant-larret-du-systeme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sauvegarde et restauration du MBR sous Linux</title>
		<link>http://tavie.onsenfout.com/2007/10/07/sauvegarde-et-restauration-du-mbr-sous-linux/</link>
		<comments>http://tavie.onsenfout.com/2007/10/07/sauvegarde-et-restauration-du-mbr-sous-linux/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 21:46:41 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[mbr]]></category>
		<category><![CDATA[partitions]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[système]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=4</guid>
		<description><![CDATA[Le Master Boot Record ou MBR est situé sur le premier secteur d&#8217;un disque dur &#171;&#160;bootable&#160;&#187;. Il est précieux car il contient la table des partitions et le &#171;&#160;boot loader&#160;&#187;. Dès qu&#8217;on utilise plusieurs systèmes sur la même machine, Windows et Linux par exemple, il est prudent de conserver une sauvegarde du MBR. Si on [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (1 vote 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>Le Master Boot Record ou MBR est situé sur le premier secteur d&#8217;un disque dur &laquo;&nbsp;bootable&nbsp;&raquo;. Il est précieux car il contient la table des partitions et le &laquo;&nbsp;boot loader&nbsp;&raquo;. Dès qu&#8217;on utilise plusieurs systèmes sur la même machine, Windows et Linux par exemple, il est prudent de conserver une sauvegarde du MBR. Si on utilise Grub comme gestionnaire de boot et qu&#8217;on doit réinstaller Windows, celui-ci remplacera le MBR par le sien sans tenir compte des autres systèmes présents sur le disque. Dans ce cas c&#8217;est commode de pouvoir restaurer le boot loader. Voilà comment faire :</p>
<p><strong><em>Attention : ces explications sommaires sont destinées aux personnes qui savent ce qu&#8217;elles font, une mauvaise manip peut rendre le disque inutilisable. Vous voilà prévenus.</em></strong></p>
<p>Pour sauvegarder le MBR du disque hda dans le fichier mbr.sav :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hda <span style="color: #007800;">of</span>=mbr.sav <span style="color: #007800;">bs</span>=<span style="color: #000000;">512</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>Pour restaurer le MBR du disque hda à partir du fichier mbr.sav :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=mbr.sav <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hda <span style="color: #007800;">bs</span>=<span style="color: #000000;">512</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>Les 64 derniers octets du MBR contiennent la table des partitions<br />
Si on ne veut pas sauvegarder/restaurer la table des partition mais juste le boot loader, les commandes deviennent :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hda <span style="color: #007800;">of</span>=mbr.sav <span style="color: #007800;">bs</span>=<span style="color: #000000;">446</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span>
<span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=mbr.sav <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hda <span style="color: #007800;">bs</span>=<span style="color: #000000;">446</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span></pre></div></div>

<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (1 vote 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/2007/10/07/sauvegarde-et-restauration-du-mbr-sous-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

