{"id":3082,"date":"2020-06-26T20:26:40","date_gmt":"2020-06-26T19:26:40","guid":{"rendered":"https:\/\/kudzia.eu\/b\/?p=3082"},"modified":"2020-06-26T09:50:35","modified_gmt":"2020-06-26T08:50:35","slug":"resizing-btrfs-on-top-of-luks","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2020\/06\/resizing-btrfs-on-top-of-luks\/","title":{"rendered":"resizing btrfs on top of luks"},"content":{"rendered":"<p>recently we needed to expand storage space available on one of our servers. originally it was using RAID10 on 4 4TBSSD drives handled by Dell&#8217;s PERC h730p controller, we wanted to add 2 more 4TB drives and go from 8 to 12TB array. we&#8217;ve decided to be brave and use RAID10 -> RAID10 array expansion. and &#8211; surprisingly &#8211; we did not lose any data!<\/p>\n<p><!--more--><\/p>\n<p>first &#8211; make sure you take a backup of all data on such array. you should regularly backup your data anyway, especially when you plan to make risky operation like this. <\/p>\n<p>adding more disks to the raid10 is shown in this video &#8211; https:\/\/www.youtube.com\/watch?v=Rh_ZqE7foy8 ; it took few minutes of clicking in bios, most likely can be done with MegaCli command line tool, without a reboot. <\/p>\n<p>the expansion was quite slow, took over 24h. after that linux kernel happily reported:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsd 0:2:2:0: &#x5B;sdb] 23437636224 512-byte logical blocks: (12.0 TB\/10.9 TiB)\r\nsdb: detected capacity change from 8000046497792 to 12000069746688\r\n<\/pre>\n<p>structure of the block devices once raid expansion has finished shows new size for sdb, but not for the underlying partition, luks container and file system mounted from it &#8211; output from <i>lsblk<\/i>:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsdb            8:16   0 10.9T  0 disk\r\n\u2514\u2500sdb1         8:17   0  6.9T  0 part\r\n  \u2514\u2500data     254:0    0  6.9T  0 crypt \/mnt\/data\r\n<\/pre>\n<p>\/mnt\/data is btrfs partition<\/p>\n<p>we needed to expand sdb1, then luks sitting on top of it and &#8211; at the end extend btrfs:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\napt-get install cloud-guest-utils\r\ngrowpart \/dev\/sdb 1\r\nCHANGED: partition=xxx start=xxx old: size=xxx end=xxxnew: size=xxxx,end=xxx\r\n<\/pre>\n<p>at this point <i>lsblk<\/i> will show:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsdb            8:16   0 10.9T  0 disk\r\n\u2514\u2500sdb1         8:17   0 10.9T  0 part\r\n  \u2514\u2500data     254:0    0 10.9T  0 crypt \/mnt\/data\r\n<\/pre>\n<p>btrfs that sits on top of luks&#8217;s \/dev\/mapper\/data still is not aware of the additional 4TB of space available ; <i>btrfs filesystem show \/mnt\/data\/<\/i> reports still 6.9TB. the last step needed is:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nbtrfs filesystem resize max \/mnt\/online\/\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>recently we needed to expand storage space available on one of our servers. originally it was using RAID10 on 4 4TBSSD drives handled by Dell&#8217;s PERC h730p controller, we wanted to add 2 more 4TB drives and go from 8 to 12TB array. we&#8217;ve decided to be brave and use RAID10 -> RAID10 array expansion. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-3082","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=3082"}],"version-history":[{"count":3,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3082\/revisions"}],"predecessor-version":[{"id":3085,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3082\/revisions\/3085"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=3082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=3082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=3082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}