{"id":11161,"date":"2024-09-09T19:21:00","date_gmt":"2024-09-10T00:21:00","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=11161"},"modified":"2024-09-19T13:29:05","modified_gmt":"2024-09-19T18:29:05","slug":"removing-and-recreating-a-zfs-pool","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=11161","title":{"rendered":"Removing and Recreating a ZFS Pool"},"content":{"rendered":"\n<p>In testing out various ways to achieve disk compression on our PostgreSQL servers, I ended up with a server build with a version of ZFS newer that the package distribution. Which means I needed to recreate the pool to use an older version of ZFS that would be updated as part of the routine patching. Beyond backing up and restoring the data &#8230; <\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># Get rid of existing pool<\/h1>\n\n\n\n<p>zpool export pgpool<br>zpool destroy pgpool<br>zpool list # this still shows a pool on sdb<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># Clear the label<\/h1>\n\n\n\n<p>zpool labelclear \/dev\/sdb<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># Didn&#8217;t work, so blow away everything on sdb<\/h1>\n\n\n\n<p>dd if=\/dev\/zero of=\/dev\/sdb bs=1M count=10<br>wipefs -a \/dev\/sdb<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># Uninstall custom built zfs<\/h1>\n\n\n\n<p>cd \/root\/zfs<br>make uninstall<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Install new ZFS<\/h1>\n\n\n\n<p>yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm<br>yum install kernel-devel<\/p>\n\n\n\n<p>yum install https:\/\/zfsonlinux.org\/epel\/zfs-release-2-3$(rpm &#8211;eval &#8220;%{dist}&#8221;).noarch.rpm<br>dnf config-manager &#8211;disable zfs<br>dnf config-manager &#8211;enable zfs-kmod<br>yum install zfs<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># Sign kernel modules<\/h1>\n\n\n\n<p>\/usr\/src\/kernels\/$(uname -r)\/scripts\/sign-file sha256 \/root\/signing\/MOK.priv \/root\/signing\/MOK.der \/lib\/modules\/$(uname -r)\/extras\/zfs\/avl\/zavl.ko<br>&#8230;<br>\/usr\/src\/kernels\/$(uname -r)\/scripts\/sign-file sha256 \/root\/signing\/MOK.priv \/root\/signing\/MOK.der \/lib\/modules\/$(uname -r)\/extras\/zfs\/zfs\/zfs.ko<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># Reboot<\/h1>\n\n\n\n<p>init 6<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"># And start over &#8212; recreate the pool<\/h1>\n\n\n\n<p>zpool create pgpool sdb<br>zfs create pgpool\/pgdata<br>zfs set compression=lz4 pgpool\/pgdata<br>df -h \/pgpool\/pgdata\/<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In testing out various ways to achieve disk compression on our PostgreSQL servers, I ended up with a server build with a version of ZFS newer that the package distribution. Which means I needed to recreate the pool to use an older version of ZFS that would be updated as part of the routine patching. &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[2019,1944],"class_list":["post-11161","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-openzfs","tag-zfs"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11161"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11161\/revisions"}],"predecessor-version":[{"id":11162,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/11161\/revisions\/11162"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}