<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Disks on inetshell</title><link>https://inet.sh/en/tags/disks/</link><description>Recent content in Disks on inetshell</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 19 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://inet.sh/en/tags/disks/index.xml" rel="self" type="application/rss+xml"/><item><title>Replace a disk in a ZFS pool</title><link>https://inet.sh/en/posts/zfs/replace-disks/</link><pubDate>Wed, 19 Aug 2026 00:00:00 +0000</pubDate><guid>https://inet.sh/en/posts/zfs/replace-disks/</guid><description>zpool replace -f to swap an OFFLINE or GUID disk on ZFS on Linux / Proxmox, then wait for resilver.</description><content:encoded><![CDATA[<h2 id="tldr">TL;DR</h2>
<p>OFFLINE disk: <code>zpool replace -f &lt;GUID&gt; /dev/disk/by-id/…</code> — GUID from <code>zpool status</code>, not <code>/dev/sdX</code>.</p>
<p>Proxmox documents the case: <a href="https://pve.proxmox.com/wiki/ZFS_on_Linux#sysadmin_zfs_change_failed_dev">ZFS on Linux — change a failed device</a>. The symptom is an <code>OFFLINE</code> / <code>FAULTED</code> vdev and a long number instead of <code>sde</code>.</p>
<h2 id="status">Status</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">zpool status vol1
</span></span></code></pre></td></tr></table>
</div>
</div><p>The dead member often shows up as a GUID:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">1894156996840098641  OFFLINE
</span></span></code></pre></td></tr></table>
</div>
</div><p>That happens when the kernel no longer has a <code>/dev/sdX</code> for that disk (you yanked it, it died, or the letter moved).</p>
<h2 id="replace">Replace</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">zpool replace -f vol1 <span class="m">1894156996840098641</span> /dev/disk/by-id/ata-NEWDISK
</span></span></code></pre></td></tr></table>
</div>
</div><p><code>-f</code> forces if ZFS still “remembers” the old disk. The replacement must be <strong>at least</strong> the same size (prefer by-id, not <code>sde</code>).</p>
<p>If the new disk <strong>is</strong> in the same slot and ZFS sees it:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">zpool replace vol1 /dev/disk/by-id/ata-OLDDISK /dev/disk/by-id/ata-NEWDISK
</span></span></code></pre></td></tr></table>
</div>
</div><p>or auto-detect a replacement in-place:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">zpool replace vol1 /dev/disk/by-id/ata-OLDDISK
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="wait-for-resilver">Wait for resilver</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">zpool status vol1
</span></span><span class="line"><span class="cl">watch -n <span class="m">5</span> zpool status vol1
</span></span></code></pre></td></tr></table>
</div>
</div><p>Do not reboot, export, or start another replace on the same vdev until <code>resilvered</code>. On RAIDZ1 you are one disk down: a second failure in that window is data loss.</p>
<h2 id="afterwards">Afterwards</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">zpool detach vol1 <span class="m">1894156996840098641</span>   <span class="c1"># only if status still shows it as spare/old</span>
</span></span><span class="line"><span class="cl">zpool labelclear /dev/sdOLD             <span class="c1"># if you reuse the old disk elsewhere</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>See also: <a href="/en/posts/zfs/import-after-power-outage/">import after a power outage</a>.</p>
]]></content:encoded></item></channel></rss>