{"id":208,"date":"2015-06-24T10:15:42","date_gmt":"2015-06-24T08:15:42","guid":{"rendered":"http:\/\/mail-e.dk\/pmsapp.org\/?p=208"},"modified":"2015-06-24T10:15:42","modified_gmt":"2015-06-24T08:15:42","slug":"expand-a-zpool-with-a-single-supporting-device-on-linux","status":"publish","type":"post","link":"https:\/\/mail-e.dk\/pmsapp.org\/?p=208","title":{"rendered":"Expand a zpool with a single supporting device on linux"},"content":{"rendered":"<h3>Initial status:<\/h3>\n<p>Because I have had trouble with the way ZFS on Linux (ZOL) handles failing drives, I have decided to create a software<br \/>\nRAID set of my drives before creating my zpool.<\/p>\n<p>This means that my zpool is created with a single device (\/dev\/md0). If I remember correctly, it was created like this:<\/p>\n<pre>zpool create pool0 md0<\/pre>\n<h3>Expansion:<\/h3>\n<p>By default pool&#8217;s are not set to autoexpand so it is needed to set the autoexpand to on:<\/p>\n<pre>zpool set autoexpand=on pool0<\/pre>\n<p>Before I could get the pool expanded I needed to grow my RAID set. It is done by first adding a device to the existing<br \/>\nRAID set and then &#8220;growing&#8221; it with the new amount of devices.<\/p>\n<pre>mdadm \/dev\/md0 --add \/dev\/sdd\r\nmdadm --grow \/dev\/md0 --raid-devices=4\r\n<\/pre>\n<p>After the RAID set have reshaped, the extra space is available for use. According to all information I could find,<br \/>\nit should be possible to expand the pool by either exporting and importing it<\/p>\n<pre>zpool export pool0\r\nzpool import pool0\r\n<\/pre>\n<p>or by expanding the online pool<\/p>\n<pre>zpool online -e pool0 md0<\/pre>\n<p>I trid both several times and in different order, but to no avail. My pool was fixed at its original size.<\/p>\n<h3>Reboot:<\/h3>\n<p>Finally I decided to do a reboot to see if that would change anything. Remember to save the new mdadm configuration before<br \/>\nrebooting.<\/p>\n<pre># Remove existing array configuration from mdadm.conf file\r\ngrep -v ARRAY \/etc\/mdadm\/mdadm.conf &gt; \/tmp\/mdadm.conf\r\n# Add new array configuration to mdadm.conf\r\ncat \/tmp\/mdadm.conf &gt; \/etc\/mdadm\/mdadm.conf\r\nmdadm --examine --scan &gt;&gt; \/etc\/mdadm\/mdadm.conf\r\n<\/pre>\n<p>After the reboot the pool was still the original size, but now it actually worked to do an online expansion.<\/p>\n<pre>zpool online -e pool0 md0<\/pre>\n<p>And that solved the problem. Unfortunately I do not know why I could not perform the online expansion without a reboot.<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>Share<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-208\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/mail-e.dk\/pmsapp.org\/?p=208&amp;share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-208\" class=\"share-facebook sd-button share-icon\" href=\"https:\/\/mail-e.dk\/pmsapp.org\/?p=208&amp;share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Initial status: Because I have had trouble with the way ZFS on Linux (ZOL) handles failing drives, I have decided to create a software RAID set of my drives before creating my zpool. This means that my zpool is created &hellip; <a href=\"https:\/\/mail-e.dk\/pmsapp.org\/?p=208\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>Share<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-208\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/mail-e.dk\/pmsapp.org\/?p=208&amp;share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-208\" class=\"share-facebook sd-button share-icon\" href=\"https:\/\/mail-e.dk\/pmsapp.org\/?p=208&amp;share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p2gkts-3m","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=\/wp\/v2\/posts\/208"}],"collection":[{"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208"}],"version-history":[{"count":1,"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":209,"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=\/wp\/v2\/posts\/208\/revisions\/209"}],"wp:attachment":[{"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mail-e.dk\/pmsapp.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}