<?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>Void And Any &#187; ZFS</title>
	<atom:link href="http://voidandany.free.fr/index.php/category/informatique/linux/zfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Créer un miroir ZFS avec un seul disque</title>
		<link>http://voidandany.free.fr/index.php/creer-un-miroir-zfs-avec-un-seul-disque/</link>
		<comments>http://voidandany.free.fr/index.php/creer-un-miroir-zfs-avec-un-seul-disque/#comments</comments>
		<pubDate>Tue, 01 Sep 2015 11:33:34 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4782</guid>
		<description><![CDATA[Pour une raison de disponibilité de disque on peut vouloir créer un miroir ZFS avec un seul disque, voici comment procéder : Créer un fichier de type bloc simulant le disque manquant : sudo dd if=/dev/zero of=/zfs1 bs=1 count=1 seek=1024G &#8230; <a href="http://voidandany.free.fr/index.php/creer-un-miroir-zfs-avec-un-seul-disque/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Pour une raison de disponibilité de disque on peut vouloir créer un miroir ZFS avec un seul disque, voici comment procéder :</p>
<p>Créer un fichier de type bloc simulant le disque manquant :</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;">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>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>zfs1 <span style="color: #007800;">bs</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">seek</span>=1024G</pre></div></div>

<p>(j&#8217;aurai tendance à dire que la taille du fichier, seek doit être égal à la taille du disque manquant, dans le pool ZFS, mais je n&#8217;ai pas testé plus que cela)</p>
<p>Création du pool ZFS miroir avec le disque que l&#8217;on a et le fichier bloc.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> zpool create <span style="color: #660033;">-f</span> tank mirror <span style="color: #000000; font-weight: bold;">/</span>zfs1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdd</pre></div></div>

<p>(si le pool existe déjà on utilisera la commande zpool add -f pour ajouter un nouveau miroir)</p>
<p>On enlève le périphérique bloc et on le supprime.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> zpool offline tank <span style="color: #000000; font-weight: bold;">/</span>zfs1
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>zfs1</pre></div></div>

<p>Vérification :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> zpool status
&nbsp;
  pool: tank
 state: DEGRADED
status: One or <span style="color: #c20cb9; font-weight: bold;">more</span> devices has been taken offline by the administrator.
        Sufficient replicas exist <span style="color: #000000; font-weight: bold;">for</span> the pool to <span style="color: #7a0874; font-weight: bold;">continue</span> functioning <span style="color: #000000; font-weight: bold;">in</span> a
        degraded state.
action: Online the device using <span style="color: #ff0000;">'zpool online'</span> or replace the device with
        <span style="color: #ff0000;">'zpool replace'</span>.
  scan:
config:
&nbsp;
 NAME                                 STATE     READ WRITE CKSUM
 tank                                 DEGRADED     <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>
   mirror-<span style="color: #000000;">0</span>                           DEGRADED     <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>
     <span style="color: #000000; font-weight: bold;">/</span>zfs1                            OFFLINE      <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>
     sdd                              ONLINE       <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span>     <span style="color: #000000;">0</span></pre></div></div>

<p>Le miroir est bien présent, le pool est dégradé car il manque un disque.</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/creer-un-miroir-zfs-avec-un-seul-disque/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
