{"id":108,"date":"2023-11-25T10:32:39","date_gmt":"2023-11-25T15:32:39","guid":{"rendered":"https:\/\/blog.lfps64.com\/?p=108"},"modified":"2026-04-10T13:32:36","modified_gmt":"2026-04-10T18:32:36","slug":"replacing-zfs-pools-with-boot-partitions-in-proxmox","status":"publish","type":"post","link":"https:\/\/blog.lfps64.com\/?p=108","title":{"rendered":"Replacing ZFS pools with boot partitions (In Proxmox)"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>I&#8217;ve created this document in order to have a clear guide to replace boot disks in a ZFS pool for proxmox, basically because the one on their documentation was not completely clear for me.<\/p>\n\n\n\n<p>Source documentation: https:\/\/pve.proxmox.com\/wiki\/ZFS_on_Linux<\/p>\n\n\n\n<p>In my case I was dealing with a Raid1 ZFS pool, both with bootable drives.<\/p>\n\n\n\n<p>I wasn&#8217;t aware these drives had 3 partitions, which I had to replicate to the new drive in order to perform the proper replacement.<\/p>\n\n\n\n<p>We replicate these partitions with the following commands:<\/p>\n\n\n\n<p><code>sgdisk &lt;healthy bootable device> -R &lt;new device>\u00a0\u00a0\u00a0 -\u00a0 (use \/dev\/diskname)<\/code><\/p>\n\n\n\n<p><code>sgdisk -G &lt;new device>\u00a0 - (use \/dev\/diskname)<\/code><\/p>\n\n\n\n<p>The the second command will make sure the new partitions that have been copied from the remaining surviving drive, have unique GUIDs, it&#8217;s a bad idea to have disks with cloned GUIDs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"390\" src=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-1.png\" alt=\"\" class=\"wp-image-111\" srcset=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-1.png 702w, https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-1-300x167.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>In the example above we see that Nvme0n1 is the remaining disk in the array, which is in good state.<\/p>\n\n\n\n<p>Nvme0n2 is the new one, the one we are going to used to replace the failed one.<\/p>\n\n\n\n<p>Knowing this we run the following commands:<\/p>\n\n\n\n<p><code>sgdisk \/dev\/nvme0n1 -R \/dev\/nvme0n2<\/code><\/p>\n\n\n\n<p><code>sgdisk -G \/dev\/nvme0n2<\/code><\/p>\n\n\n\n<p><kbd><em>The last command should output: The operation has completed successfully.<\/em><\/kbd><\/p>\n\n\n\n<p>After, we should see the partitions replicated:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"368\" src=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-2.png\" alt=\"\" class=\"wp-image-112\" srcset=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-2.png 703w, https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-2-300x157.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>Now, we need to add the partition 3 to the ZFS pool array. Previously I made the mistake of adding the complete disk, which would destroy the partitions created and will not let you install the boot partition into the disk. <\/p>\n\n\n\n<p>Avoid that mistake, what we need to add is the disk to the array, not the complete disk.<\/p>\n\n\n\n<p>Lets move now to identify the partition ID we want to replicate:<\/p>\n\n\n\n<p><code>ls -lh \/dev\/disk\/by-id\/<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"982\" height=\"377\" src=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-3.png\" alt=\"\" class=\"wp-image-113\" style=\"width:831px;height:auto\" srcset=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-3.png 982w, https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-3-300x115.png 300w, https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-3-768x295.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>We know the new disk is the nvme0n2, and we know the partition is nvme0n2p3, so the ID we&#8217;ll use now its: <\/p>\n\n\n\n<p><strong>nvme-VMware_Virtual_NVMe_Disk_VMware_NVME_0000_2-part3<\/strong><\/p>\n\n\n\n<p>The command we need to now follow its:<\/p>\n\n\n\n<p><code># zpool replace -f &lt;pool> &lt;failed disk id> &lt;new zfs partition><\/code><\/p>\n\n\n\n<p>From the first image in the document, we know the failed partition has this ID: 15896803577790237437<\/p>\n\n\n\n<p>The resulting command should be:<\/p>\n\n\n\n<p><code>zpool replace -f rpool 15896803577790237437 nvme-VMware_Virtual_NVMe_Disk_VMware_NVME_0000_2-part3<\/code><\/p>\n\n\n\n<p>Do NOT do it like this:<\/p>\n\n\n\n<p><s> <strong><code>zpool replace -f rpool 15896803577790237437 \/dev\/nvme0n2p3<\/code><\/strong><\/s><\/p>\n\n\n\n<p>The zpool replace command will start a <a href=\"https:\/\/blocksandfiles.com\/2022\/06\/20\/resilvering\/\" data-type=\"link\" data-id=\"https:\/\/blocksandfiles.com\/2022\/06\/20\/resilvering\/\">resilvering <\/a>process, which you should monitor until its 100% complete before moving forward.<\/p>\n\n\n\n<p>We can monitor this process with the command: <\/p>\n\n\n\n<p><code>watch zpool status -v<\/code><\/p>\n\n\n\n<p>Once this process is completed, you can move on to install the boot files in the p2 partition for the drive<\/p>\n\n\n\n<p>First we need to validate if we are using UEFI or GRUB with the following command:<\/p>\n\n\n\n<p><code>proxmox-boot-tool status<\/code><\/p>\n\n\n\n<p>You need to validate if the system says you are booting with legacy bios or UEFI.<\/p>\n\n\n\n<p><code># <strong>proxmox-boot-tool format<\/strong> &lt;new disk's ESP><\/code><\/p>\n\n\n\n<p>In the example we are using, we know the boot partition should be \/dev\/nvme0n2p2, so following the example above the next command should be:<\/p>\n\n\n\n<p><code>proxmox-boot-tool format \/dev\/nvme0n2p2<\/code><\/p>\n\n\n\n<p><code>#<strong> proxmox-boot-tool init<\/strong> &lt;new disk's ESP>\u00a0 <strong>[grub]<\/strong> (optional)<\/code><\/p>\n\n\n\n<p>After formatting the partition, we proceed to install the boot files, if we are using grub the command should be:<\/p>\n\n\n\n<p><code>proxmox-boot-tool init \/dev\/nvme0n2p2<\/code> <code><strong>[grub]<\/strong><\/code><\/p>\n\n\n\n<p>If we are using UEFI, the command should be:<\/p>\n\n\n\n<p><code>proxmox-boot-tool init \/dev\/nvme0n2p2 <\/code><\/p>\n\n\n\n<p>Then we proceed to clean the previous boot entries that are no longer relevant with the following command:<\/p>\n\n\n\n<p><code>proxmox-boot-tool clean<\/code><\/p>\n\n\n\n<p>You can now proceed to validate if the boot partitions have been correctly installed with the following commands:<\/p>\n\n\n\n<p><strong><code>proxmox-boot-tool status<\/code><\/strong><\/p>\n\n\n\n<p><strong><code>cat \/etc\/kernel\/proxmox-boot-uuids<\/code><\/strong><\/p>\n\n\n\n<p>The output should look similar to this (Legacy Bios example)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"170\" src=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-4.png\" alt=\"\" class=\"wp-image-114\" srcset=\"https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-4.png 626w, https:\/\/blog.lfps64.com\/wp-content\/uploads\/2023\/11\/imagen-4-300x81.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>Since this is a raid1 pool with 2 disk, we should only see two lines per output.<\/p>\n\n\n\n<p>You should now be able to boot from both drives!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve created this document in order to have a clear guide to replace boot disks in a ZFS pool for proxmox, basically because the one on their documentation was not completely clear for me. Source documentation: https:\/\/pve.proxmox.com\/wiki\/ZFS_on_Linux In my case I was dealing with a Raid1 ZFS pool, both with bootable drives. I wasn&#8217;t aware &hellip; <a href=\"https:\/\/blog.lfps64.com\/?p=108\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Replacing ZFS pools with boot partitions (In Proxmox)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[17,13,16,19,18],"_links":{"self":[{"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=\/wp\/v2\/posts\/108"}],"collection":[{"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=108"}],"version-history":[{"count":1,"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions\/115"}],"wp:attachment":[{"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lfps64.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}