{"id":1363,"date":"2025-05-29T18:41:28","date_gmt":"2025-05-29T16:41:28","guid":{"rendered":"https:\/\/daisy-street.fr\/?p=1363"},"modified":"2025-05-29T19:15:20","modified_gmt":"2025-05-29T17:15:20","slug":"mirror-pve-root-using-lvm-raid1","status":"publish","type":"post","link":"https:\/\/daisy-street.fr\/index.php\/2025\/05\/29\/mirror-pve-root-using-lvm-raid1\/","title":{"rendered":"Mirror pve-root Using LVM RAID1"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">What this means:<\/h3>\n\n\n\n<p>You configure a <strong>mirror (RAID1)<\/strong> so that any write to <code>pve-root<\/code> is also written to <code>sda1<\/code>. If your NVMe dies, you can still boot from <code>sda1<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf1 Requirements:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>sda1<\/code> must be equal to or larger than <code>pve-root<\/code> (96 GB in your case)<\/li>\n\n\n\n<li>You must convert <code>pve-root<\/code> into a RAID1 logical volume (LVM mirror)<\/li>\n\n\n\n<li>Some downtime or maintenance mode required<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf0 How-To (Overview Only):<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Backup First!<\/strong> (Always)<\/li>\n\n\n\n<li><strong>Check current setup:<\/strong> \n<ul class=\"wp-block-list\">\n<li><code>lvdisplay pve\/root<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Wipe and prep <code>sda1<\/code>:<\/strong> \n<ul class=\"wp-block-list\">\n<li><code>pvcreate \/dev\/sda<\/code><\/li>\n\n\n\n<li><code>vgextend pve \/dev\/sda<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Convert <code>pve-root<\/code> to RAID1:<\/strong> \n<ul class=\"wp-block-list\">\n<li><code>lvconvert --type mirror -m1 --mirrorlog core pve\/root \/dev\/sda<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>This mirrors <code>pve\/root<\/code> from your NVMe disk onto <code>sda<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Option<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>--type mirror<\/code><\/td><td>Convert the LV to a mirror (RAID1)<\/td><\/tr><tr><td><code>-m1<\/code><\/td><td>Use 1 mirror copy = total of 2 devices<\/td><\/tr><tr><td><code>--mirrorlog core<\/code><\/td><td>Store mirror log in RAM<\/td><\/tr><tr><td><code>pve\/root<\/code><\/td><td>The logical volume to convert (your root)<\/td><\/tr><tr><td><code>\/dev\/sda<\/code><\/td><td>The new disk to mirror onto<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Confirm with: \n<ul class=\"wp-block-list\">\n<li><code>lvs -a -o +devices<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>root@pve:~# lvs -a -o +devices\n  LV              VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices\n  data            pve twi-aotz-- 794.30g             0.01   0.24                             data_tdata(0)\n  [data_tdata]    pve Twi-ao---- 794.30g                                                     \/dev\/nvme0n1p3(26624)\n  [data_tmeta]    pve ewi-ao----   8.10g                                                     \/dev\/nvme0n1p3(229966)\n  [lvol0_pmspare] pve ewi-------   8.10g                                                     \/dev\/nvme0n1p3(232040)\n  root            pve mwi-aom---  96.00g                                    100.00           root_mimage_0(0),root_mimage_1(0)\n  [root_mimage_0] pve iwi-aom---  96.00g                                                     \/dev\/nvme0n1p3(2048)\n  [root_mimage_1] pve iwi-aom---  96.00g                                                     \/dev\/sda(0)\n  swap            pve -wi-ao----   8.00g                                                     \/dev\/nvme0n1p3(0)\n<\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Optional but smart:<\/strong> Update your bootloader (<code>grub<\/code>) to know how to boot from either disk:\n<ul class=\"wp-block-list\">\n<li>update-initramfs -u<\/li>\n\n\n\n<li>update-grub<\/li>\n\n\n\n<li>grub-install \/dev\/sda<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Pros:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Real-time mirroring (RAID1)<\/li>\n\n\n\n<li>Transparent failover if one device fails (bootable if configured)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u26a0\ufe0f Cons:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adds complexity<\/li>\n\n\n\n<li>If misconfigured, can break boot<\/li>\n\n\n\n<li>Doesn\u2019t protect against file deletion or config mistakes (RAID is not a backup)<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">how to <strong>check the mirror status, detect failures, and know when to do maintenance<\/strong>:<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Use <code>lvdisplay<\/code> for more detail:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>lvdisplay \/dev\/pve\/root<br><\/code><\/pre>\n\n\n\n<p>Look for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Mirror status: OK<\/code> (or similar)<\/li>\n\n\n\n<li>If a device has failed, you\u2019ll see something like \u201cfailed\u201d or \u201cinconsistent\u201d<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>What this means: You configure a mirror (RAID1) so that any write to pve-root is also written to sda1. If your NVMe dies, you can still boot from sda1. \ud83e\uddf1 Requirements: \ud83e\uddf0 How-To (Overview Only): This mirrors pve\/root from your NVMe disk onto sda. Option Meaning &#8211;type mirror Convert the LV to a mirror (RAID1) &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/daisy-street.fr\/index.php\/2025\/05\/29\/mirror-pve-root-using-lvm-raid1\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mirror pve-root Using LVM RAID1&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[243],"tags":[78,14,246],"class_list":["post-1363","post","type-post","status-publish","format-standard","hentry","category-proxmox","tag-disk","tag-proxmox","tag-raid"],"jetpack_publicize_connections":[],"featured_image_src":null,"author_info":{"display_name":"admin9483","author_link":"https:\/\/daisy-street.fr\/index.php\/author\/admin9483\/"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/1363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":3,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"predecessor-version":[{"id":1366,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/1363\/revisions\/1366"}],"wp:attachment":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}