{"id":197,"date":"2020-09-28T01:46:31","date_gmt":"2020-09-28T01:46:31","guid":{"rendered":"https:\/\/marshallpdavis.com\/?page_id=197"},"modified":"2024-02-26T03:54:24","modified_gmt":"2024-02-26T03:54:24","slug":"image-backup","status":"publish","type":"page","link":"https:\/\/marshallpdavis.com\/?page_id=197","title":{"rendered":"Image backup"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I have a ZFS pool named &#8220;storage&#8221; I back up my NVMe drive to. These instructions are for my use case, if you find them useful, great, but be careful, as it is your data and your responsibility!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Boot from ArchLinux ISO <br>Make sure you have network access per the Installation wiki<br><code>timedatectl<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure we have enough space for installing needed packages, etc:<br><code>mount -o remount,size=50% \/run\/archiso\/cowspace<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Establish repos and update keyring:<br><code>pacman -Sy<br>pacman -S archlinux-keyring<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the archzfs repo:<br><code>cat &gt;&gt; \/etc\/pacman.conf &lt;&lt;\"EOF\"<br>[archzfs]<br>Server = http:\/\/archzfs.com\/archzfs\/x86_64<br>EOF<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Get keys sorted:<br><code>pacman-key --populate archlinux<br>pacman-key --recv-keys F75D9D76<br>pacman-key --lsign-key F75D9D76<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Adde the ArchLinux archives to get the correct kernel and headers to match the booted ArchISO<br>NOTE: $version here is the date of the archiso, eg 2024\/02\/01, so for the ISO for Feb 2024: <br>echo &#8220;Server=https:\/\/archive.archlinux.org\/repos\/2024\/02\/01\/\\$repo\/os\/\\$arch&#8221; &gt; \/etc\/pacman.d\/mirrorlist<br>Also note this DOES replace the existing mirrorlist, so make a backup before the next command, if you wish:<br><code>echo \"Server=https:\/\/archive.archlinux.org\/repos\/$version\/\\$repo\/os\/\\$arch\" &gt; \/etc\/pacman.d\/mirrorlist<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now install the matching headers to the version of the kernel running while booted from the ArchISO &#8211; Note: you can leave out linux if you want, but it prevents an error during dkms installation &#8211; the error does not prevent loading of the zfs module:<br><code>pacman -Syy<br>pacman -S linux linux-headers<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And install the zfs-dkms package from ArchZFS repo and other required packages:<br><code>pacman -S zfs-dkms<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Load the zfs module &#8211; if you left out the linux package, updating linux initcpios will fail, but the module should still load:<br><code>modprobe zfs<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we can mount the existing pool and backup:<br><code>zpool import storage<br>dd if=\/dev\/nvme0n1 bs=256M | zstd -19 -T11 --sparse &gt; \/storage\/archwks.img.zst<br>zstd -t \/storage\/archwks.img.zst<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For making a copy of qcow2, cleans up churn growth:<br><code>qemu-img convert -O qcow2 win10-2.qcow2 win10.qcow2<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a ZFS pool named &#8220;storage&#8221; I back up my NVMe drive to. These instructions are for my use case, if you find them useful, great, but be careful, as it is your data and your responsibility! Boot from ArchLinux ISO Make sure you have network access per the Installation wikitimedatectl Make sure we &hellip; <a href=\"https:\/\/marshallpdavis.com\/?page_id=197\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Image backup<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-197","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=197"}],"version-history":[{"count":7,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/197\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/197\/revisions\/234"}],"wp:attachment":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}