<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ricardo</title>
    <description>The latest articles on DEV Community by Ricardo (@thoughtrefraction).</description>
    <link>https://dev.to/thoughtrefraction</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F468027%2F86d88174-e811-4697-bd8b-9509709f74c9.png</url>
      <title>DEV Community: Ricardo</title>
      <link>https://dev.to/thoughtrefraction</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thoughtrefraction"/>
    <language>en</language>
    <item>
      <title>Tips For Replacing a Proxmox Boot Drive In A Pool</title>
      <dc:creator>Ricardo</dc:creator>
      <pubDate>Sat, 05 Feb 2022 21:46:13 +0000</pubDate>
      <link>https://dev.to/thoughtrefraction/tips-for-replacing-a-proxmox-boot-drive-in-a-pool-45dg</link>
      <guid>https://dev.to/thoughtrefraction/tips-for-replacing-a-proxmox-boot-drive-in-a-pool-45dg</guid>
      <description>&lt;p&gt;(My first post!)&lt;br&gt;
Recently one of my ProxMox SSD boot drives (in a RAID 1 pool) stopped working.&lt;br&gt;
After I physically replaced the bad SSD, there was no longer any device reference to it (&lt;strong&gt;&lt;em&gt;zpool replace&lt;/em&gt;&lt;/strong&gt; would fail using the old reference). The instructions I found say that you should either use /dev/sdx or /dev/disk/by-id/xxxx when referring to the old drive in a zpool command. I noticed that the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zpool status rpool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Returned a sequence of numbers for the old drive instead of the device name. Let's say it showed 1234567890.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zpool replace rpool 1234567890 /dev/disk/by-id/new_drive_id_xxxxxxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That worked! It should now attach and resilver the new drive. However, in my case the new drive had been automatically formatted without the BIOS/EFI partitions. If my original SSD ever failed, the new SSD would fail to boot.&lt;/p&gt;

&lt;p&gt;I had to detach the new drive&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zpool detach rpool /dev/disk/by-id/new_drive_id_xxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I went into the web interface, &lt;em&gt;carefully&lt;/em&gt; selected the new drive, and chose "Wipe Disk". Then I followed the standard instructions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sgdisk /dev/disk/by-id/orig_drive_id_xxxx /dev/disk/by-id/new_drive_id_xxxx
sgdisk -G /dev/disk/by-id/new_drive_id_xxxx
zpool attach -f rpool orig_drive_id_xxxx-part3 new_drive_id_xxxx-part3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This cloned the partitions onto the new drive. Then I waited for the resilver to end by checking with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zpool status rpool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I setup the 512 MB EFI partition (check if your BIOS supports EFI)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proxmox-boot-tool format /dev/disk/by-id/new_drive_id_xxxx-part2
proxmox-boot-tool init /dev/disk/by-id/new_drive_id_xxxx-part2
proxmox-boot-tool refresh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Otherwise if you use GRUB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grub-install /dev/disk/by-id/new_drive_id_xxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reboot.&lt;/p&gt;




&lt;p&gt;References:&lt;br&gt;
&lt;a href="https://dannyda.com/2020/05/16/how-to-replace-dead-physical-disk-from-proxmox-pve-for-zfs-pool-easily/"&gt;How To Replace Dead Physical Disk From Proxmox PVE For ZFS Pool Easily&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dannyda.com/2020/05/21/how-to-find-drive-name-real-name-for-dev-sdb-dev-sdc-from-proxmox-pve/"&gt;How To Find A Drive's Real Name&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://forum.proxmox.com/threads/zfs-boot-disk-no-longer-bootable-after-rpool-resilvering.77040/"&gt;ZFS Boot Disk No Longer Bootable&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#_zfs_administration"&gt;ZFS Administration&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#sysboot_proxmox_boot_setup"&gt;Sysboot ProxMox Boot Setup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pve.proxmox.com/wiki/Host_Bootloader"&gt;Host Bootloader&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case you need to track down the device by UUID:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://linuxhint.com/uuid_storage_devices_linux/"&gt;Linux uuid storage devices&lt;/a&gt;&lt;/p&gt;

</description>
      <category>proxmox</category>
      <category>zfs</category>
    </item>
  </channel>
</rss>
