{"id":291,"date":"2022-10-23T00:47:56","date_gmt":"2022-10-22T16:47:56","guid":{"rendered":"https:\/\/www.ddzheng.cc\/?p=291"},"modified":"2023-08-15T00:40:10","modified_gmt":"2023-08-14T16:40:10","slug":"building-a-nas-with-a-cursed-motherboard-%e7%94%a8%e7%81%b5%e8%bd%a6%e4%b8%bb%e6%9d%bf%e7%bb%84%e8%a3%85%e4%b8%80%e5%8f%b0nas","status":"publish","type":"post","link":"https:\/\/www.ddzheng.cc\/?p=291","title":{"rendered":"Building a NAS with a Cursed Motherboard \/ \u7528\u7075\u8f66\u4e3b\u677f\u7ec4\u88c5\u4e00\u53f0NAS"},"content":{"rendered":"\n<p>I have been wanting to build a NAS for a long time. My main goal is to provide some reliability improvement to the data safety issue I have been facing, where I&#8217;m constantly running out of storage space and a lot of my data does not have a local backup.<\/p>\n\n\n\n<p>For this build, I used TrueNAS Scale which is a fairly new addition to the TrueNAS portfolio. I choose this version over traditional BSD-based TrueNAS since I&#8217;m a lot more familiar with Debian.<\/p>\n\n\n\n<p>To safely use ZFS, ECC memory is required.<\/p>\n\n\n<h1 class=\"wp-block-heading\" id=\"the-motherboard\">The Motherboard<\/h1>\n\n\n<p>The motherboard is a JGINYUE(\u7cbe\u7ca4) X99I-SERVER, a new ITX motherboard with x99 chipset and <strong>dual 2.5GbE<\/strong>. I acquired this set from a friend, it cost me \uffe51400 or about $200, which includes the motherboard, a Xeon E5-2650v4 CPU and a pair of Kingston DDR4 2400 32G REG-ECC memory. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0570.jpg\" alt=\"\" class=\"wp-image-292\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0570.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0570-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0570-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0570-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0570-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"293\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0571.jpg\" alt=\"\" class=\"wp-image-293\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0571.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0571-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0571-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0571-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0571-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"294\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0572.jpg\" alt=\"\" class=\"wp-image-294\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0572.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0572-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0572-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0572-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0572-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>The heatsink is a <a href=\"https:\/\/item.taobao.com\/item.htm?id=684958717522\">COOLSERVER(\u91d1\u94b1\u8c79) R16<\/a> with 6cm fan for LGA2011. One thing to remember for LGA2011 is that it has two types, square and narrow.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"483\" height=\"316\" data-id=\"299\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-2.png\" alt=\"\" class=\"wp-image-299\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-2.png 483w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-2-256x167.png 256w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"400\" data-id=\"319\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-4.png\" alt=\"\" class=\"wp-image-319\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-4.png 400w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-4-256x256.png 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-4-100x100.png 100w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n<\/figure>\n\n\n<h1 class=\"wp-block-heading\" id=\"the-chassis\">The Chassis<\/h1>\n\n\n<p>The chassis I used is a 4-bay NAS chassis, branded as &#8220;MineNAS&#8221;, which is a lower trim version of the <a href=\"https:\/\/www.truenas.com\/blog\/breaking-down-the-freenas-mini-e\/\">TrueNAS Mini E<\/a> or <a href=\"https:\/\/www.supermicro.com\/en\/products\/system\/midtower\/5028\/SYS-5028D-TN4T.cfm\">Supermicro 5028D-TN4T<\/a>. I bought it second-hand on Xianyu (\u95f2\u9c7c) for \uffe5350 including the original 250W PSU. <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"296\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0578.jpg\" alt=\"\" class=\"wp-image-296\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0578.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0578-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0578-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0578-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0578-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"295\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0579.jpg\" alt=\"\" class=\"wp-image-295\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0579.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0579-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0579-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0579-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0579-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n<\/figure>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"340\" data-id=\"297\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image.png\" alt=\"\" class=\"wp-image-297\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image.png 512w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-256x170.png 256w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"720\" data-id=\"298\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-1.png\" alt=\"\" class=\"wp-image-298\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-1.png 960w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-1-720x540.png 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-1-256x192.png 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-1-768x576.png 768w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/figure>\n<\/figure>\n\n\n<h1 class=\"wp-block-heading\" id=\"storage\">Storage<\/h1>\n\n\n<p>For system disks 2 Toshiba MLC SATA SSD were used in a mirrored fashion.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1440\" height=\"1920\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0586.jpg\" alt=\"\" class=\"wp-image-300\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0586.jpg 1440w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0586-540x720.jpg 540w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0586-192x256.jpg 192w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0586-768x1024.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0586-1152x1536.jpg 1152w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><\/figure>\n\n\n\n<p>For actual data storage, I used 4 Western Digital (formerly Hitachi, HGST) 16TB HC550 datacenter hard drives.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1440\" height=\"1920\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0594.jpg\" alt=\"\" class=\"wp-image-301\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0594.jpg 1440w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0594-540x720.jpg 540w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0594-192x256.jpg 192w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0594-768x1024.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0594-1152x1536.jpg 1152w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><\/figure>\n\n\n<h1 class=\"wp-block-heading\" id=\"hardware-assembling\">Hardware Assembling<\/h1>\n\n\n<p>Assembling was mostly easy, but there were also quite a few annoying quirks. Firstly the chassis is missing the front optical drive panel, and the PCI-E slot cover, which I solved by 3D printing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0591.jpg\" alt=\"\" class=\"wp-image-302\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0591.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0591-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0591-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0591-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0591-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>The chassis fan supplied by the former owner was complete garbage. I dug through my component bin and found a mighty Nidec TA450 fan which has 160 CFM, rated at 12V 1.4A.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0580.jpg\" alt=\"\" class=\"wp-image-303\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0580.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0580-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0580-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0580-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0580-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>The problem with this fan is that it was ripped out of a Dell Optiplex, and has Dell fan connector. Luckily, the pitch of that connector is the same as normal fan connector, so I only had to change the pin order.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0581.jpg\" alt=\"\" class=\"wp-image-304\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0581.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0581-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0581-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0581-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0581-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>The SATA backplane was also a lower-trim version which only had one power connector. Although one is absolutely fine, for some peace of mind I still decided to solder on another one.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"306\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0600.jpg\" alt=\"\" class=\"wp-image-306\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0600.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0600-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0600-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0600-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0600-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"305\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0601.jpg\" alt=\"\" class=\"wp-image-305\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0601.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0601-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0601-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0601-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0601-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>The motherboard tested fine when used out of the chassis, but once I put it in the tray it no longer want to boot. Took some time before I found out the problem was the external clear-CMOS button was stuck pressed. The back panel was about 1mm higher than it should be and pinched the button. So I drilled the button hole to a much larger diameter.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"307\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0584.jpg\" alt=\"\" class=\"wp-image-307\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0584.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0584-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0584-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0584-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0584-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" data-id=\"308\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0583.jpg\" alt=\"\" class=\"wp-image-308\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0583.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0583-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0583-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0583-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0583-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n<\/figure>\n\n\n<h1 class=\"wp-block-heading\" id=\"system-installation\">System Installation<\/h1>\n\n\n<p>I just plugged the USB disk and followed the GUI to install TrueNAS Scale, and before long I was greeted with a functional WebUI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0587.jpg\" alt=\"\" class=\"wp-image-309\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0587.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0587-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0587-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0587-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0587-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>At this stage, I found that the system can boot, but cannot reboot. On reboot, it get stuck at<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>freeing unused kernel image memory<\/code><\/pre>\n\n\n\n<p>Since it only happen at reboot, it is mostly related to ACPI or other power settings. After limiting processor C-state to C2, it now can boot and reboot just fine.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0596.jpg\" alt=\"\" class=\"wp-image-310\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0596.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0596-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0596-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0596-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0596-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n<h1 class=\"wp-block-heading\" id=\"software-configuration\">Software Configuration<\/h1>\n\n\n<p>I created a main pool called <code>tank<\/code> and create a dataset called <code>config<\/code> to act as home directories and store scripts.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"fan-control-scripts\">Fan Control Scripts<\/h2>\n\n\n<p><strong>Warning: TrueNAS is an appliance, and is meant to be used not modified.<\/strong> <\/p>\n\n\n\n<p>The motherboard has a very poor fan regulation function, which starts out at about 70% PWM where all the fans are screaming. So I have to set the fans to fixed 100% in BIOS and do something on the software side.<\/p>\n\n\n\n<p>I first confirm that my SuperIO chip is supported by running<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sensors-detect<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"46\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-3.png\" alt=\"\" class=\"wp-image-312\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-3.png 706w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-3-256x17.png 256w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p>At the end of the detection, sensors-detect can automatically insert needed kernel module into <code>\/etc\/modules<\/code>. Note this may not persist across TrueNAS update.<\/p>\n\n\n\n<p>Next I have to find a way to control the fan speed. For this I need the <code>fancontrol<\/code> package, which unfortunately didn&#8217;t come with install. TrueNAS also disabled <code>apt<\/code> use by default. So I had to do the following to install the package. This will not persist across update as well.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x \/bin\/apt*\napt-get install fancontrol<\/code><\/pre>\n\n\n\n<p>I would like to control the chassis fan based on the temperature of the disk which is hottest, and <code>fancontrol<\/code> does not offer this function. I found some related stuff <a href=\"https:\/\/askubuntu.com\/questions\/22108\/how-to-control-fan-speed\">here<\/a>, and wrote some script based on the code there. Basically it reads drive temperature, found out the maximum value and store it as milli-degree-Celsius in a file for <code>fancontrol<\/code> to read in as a sensor value. It also handles situation where return value is &#8220;&#8221; (when drive is in spin-down).<\/p>\n\n\n\n<p>For this to work I used the <code>hddtemp<\/code> package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install hddtemp<\/code><\/pre>\n\n\n\n<p>Here is my script (drive string is removed), located at <code>\/mnt\/tank\/config\/home\/admin\/gethddtemp.sh<\/code>. To use it one need to add their disks to the array. The strings can be found at <code>\/dev\/disk\/by-id\/<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>admin@TRUENAS:~$ cat gethddtemp.sh\ndeclare -a DiskList=(\n\"ata-WDC_WUH721816ALE6L4_2P111111\"\n\"ata-WDC_WUH721816ALE6L4_2P222222\"\n\"ata-WDC_WUH721816ALE6L4_2P333333\"\n\"ata-WDC_WUH721816ALE6L4_2P444444\"\n)\n\nFILE=\/tmp\/Hddtemp\nre='^&#91;0-9]+$'\n\nwhile true\ndo\n  maxtemp=0\n  for disk in \"${DiskList&#91;@]}\"; do\n    temperature=$(hddtemp -n \/dev\/disk\/by-id\/$disk 2&gt;\/dev\/null)\n    # Set base temp if we got nothing in stdout, this mean we are asleep\n    if ! &#91;&#91; \"$temperature\" =~ $re ]];\n      then\n        temperature=0;\n      else\n        if &#91; \"$temperature\" -ge \"$maxtemp\" ];\n          then maxtemp=\"$temperature\";\n        fi\n    fi\n  done\n\n\n  # Get a tempfile to write out temp\n  NEW=$(mktemp \/tmp\/Hddtemp.XXXX)\n  echo $(($maxtemp * 1000)) &gt; $NEW\n  # Handle case of initial\/clean run\n  if &#91; -e $FILE ]; then\n    CLEAN=\"rm -f $(readlink -f $FILE)\"\n  fi\n  # Atomic symlink replacement\n  ln -s $NEW $FILE.lnk\n  mv -T $FILE.lnk $FILE\n  # Clean old link, if it existed\n  $CLEAN\n  sleep 30\n\ndone\n<\/code><\/pre>\n\n\n\n<p>I wrote a service file <code>\/lib\/systemd\/system\/gethddtemp.service<\/code> for this script to be used as a systemd service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>admin@TRUENAS:~$ cat \/lib\/systemd\/system\/gethddtemp.service\n&#91;Service]\nExecStart=\/mnt\/tank\/config\/home\/admin\/gethddtemp.sh\nRestart=on-failure\nRestartSec=3s\n\n&#91;Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n\n\n\n<p>Next step is to configure the fancontrol config file. Here&#8217;s my <code>\/etc\/fancontrol<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>admin@TRUENAS:~$ cat \/etc\/fancontrol\n# Configuration file generated by pwmconfig, changes will be lost\nINTERVAL=1\nDEVPATH=hwmon0=devices\/platform\/coretemp.0 hwmon1=devices\/platform\/nct6775.2592\nDEVNAME=hwmon0=coretemp hwmon1=nct6779\nFCTEMPS=hwmon1\/pwm2=hwmon0\/temp1_input hwmon1\/pwm1=\/tmp\/Hddtemp\nFCFANS=hwmon1\/pwm2=hwmon1\/fan2_input hwmon1\/pwm1=hwmon1\/fan1_input\nMINTEMP=hwmon1\/pwm2=55 hwmon1\/pwm1=30\nMAXTEMP=hwmon1\/pwm2=85 hwmon1\/pwm1=50\nMINSTART=hwmon1\/pwm2=150 hwmon1\/pwm1=150\nMINSTOP=hwmon1\/pwm2=0 hwmon1\/pwm1=0\nMAXPWM=hwmon1\/pwm2=255\n<\/code><\/pre>\n\n\n\n<p>This will update the fan PWM every second, and maximum temperature allowed for hard drives are 50 \u2103 beyond which the fan will spin at full speed.<\/p>\n\n\n\n<p>I also modified the <code>fancontrol<\/code> systemd service file to depend on my service, and auto restart on failure.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>admin@TRUENAS:~$ cat \/lib\/systemd\/system\/fancontrol.service\n&#91;Unit]\nDescription=fan speed regulator\n# Run pwmconfig to create this file.\nConditionFileNotEmpty=\/etc\/fancontrol\nAfter=lm-sensors.service\n<strong>After=gethddtemp.service<\/strong>\nDocumentation=man:fancontrol(8) man:pwmconfig(8)\n\n&#91;Service]\nExecStartPre=\/usr\/sbin\/fancontrol --check\nExecStart=\/usr\/sbin\/fancontrol\nPIDFile=\/run\/fancontrol.pid\n<strong>Restart=on-failure\nRestartSec=3s<\/strong>\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>Note: if you need to used <code>fancontrol<\/code> to control fan speed based on the temperature of one hard drive, you can use the <code>drivetemp<\/code> kernel module, which parse drive temperature into ACPI sensor zones:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>admin@TRUENAS:~$ sudo modprobe drivetemp\nadmin@TRUENAS:~$ sensors\n\n...\ndrivetemp-scsi-4-0\nAdapter: SCSI adapter\ntemp1:        +30.0\u00b0C  (low  =  +5.0\u00b0C, high = +40.0\u00b0C)\n                       (crit low =  +0.0\u00b0C, crit = +80.0\u00b0C)\n                       (lowest = +27.0\u00b0C, highest = +33.0\u00b0C)\n\ndrivetemp-scsi-2-0\nAdapter: SCSI adapter\ntemp1:        +38.0\u00b0C  (low  =  +0.0\u00b0C, high = +60.0\u00b0C)\n                       (crit low = -40.0\u00b0C, crit = +70.0\u00b0C)\n                       (lowest = +30.0\u00b0C, highest = +39.0\u00b0C)\n\ndrivetemp-scsi-0-0\nAdapter: SCSI adapter\ntemp1:        +36.0\u00b0C  (low  =  +0.0\u00b0C, high = +60.0\u00b0C)\n                       (crit low = -40.0\u00b0C, crit = +70.0\u00b0C)\n                       (lowest = +29.0\u00b0C, highest = +37.0\u00b0C)\n\ndrivetemp-scsi-5-0\nAdapter: SCSI adapter\ntemp1:        +29.0\u00b0C  (low  =  +5.0\u00b0C, high = +40.0\u00b0C)\n                       (crit low =  +0.0\u00b0C, crit = +80.0\u00b0C)\n                       (lowest = +26.0\u00b0C, highest = +32.0\u00b0C)\n\ndrivetemp-scsi-3-0\nAdapter: SCSI adapter\ntemp1:        +36.0\u00b0C  (low  =  +0.0\u00b0C, high = +60.0\u00b0C)\n                       (crit low = -40.0\u00b0C, crit = +70.0\u00b0C)\n                       (lowest = +29.0\u00b0C, highest = +37.0\u00b0C)\n\ndrivetemp-scsi-1-0\nAdapter: SCSI adapter\ntemp1:        +37.0\u00b0C  (low  =  +0.0\u00b0C, high = +60.0\u00b0C)\n                       (crit low = -40.0\u00b0C, crit = +70.0\u00b0C)\n                       (lowest = +30.0\u00b0C, highest = +38.0\u00b0C)\n\n...<\/code><\/pre>\n\n\n\n<p>To find out which SCSI host is which drive, use <code>lsblk -S<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>admin@TRUENAS:~$ lsblk -S\nNAME HCTL       TYPE VENDOR   MODEL                  REV SERIAL       TRAN\nsda  0:0:0:0    disk ATA      WDC_WUH721816ALE6L4   W680 2P111111     sata\nsdb  1:0:0:0    disk ATA      WDC_WUH721816ALE6L4   W232 2P222222     sata\nsdc  2:0:0:0    disk ATA      WDC_WUH721816ALE6L4   W232 2P333333     sata\nsdd  3:0:0:0    disk ATA      WDC_WUH721816ALE6L4   W232 2P444444     sata\nsde  4:0:0:0    disk ATA      TOSHIBA_THNSNJ128GCSU 0101 XXXXXXXXTKJW sata\nsdf  5:0:0:0    disk ATA      TOSHIBA_THNSNJ128GCSU 0101 XXXXXXXXTKJW sata\n<\/code><\/pre>\n\n\n\n<p>This way you can use <code>fancontrol<\/code> in the normal way without having to resort to custom scripts.<\/p>\n\n\n<h1 class=\"wp-block-heading\" id=\"putting-the-nas-to-use\">Putting the NAS to Use<\/h1>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1440\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0599.jpg\" alt=\"\" class=\"wp-image-315\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0599.jpg 1920w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0599-720x540.jpg 720w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0599-256x192.jpg 256w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0599-768x576.jpg 768w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/DSC_0599-1536x1152.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n\n\n\n<p>For now I put the machine on the shelf in the living room. It&#8217;s October now, room temperature is about 22\u2103 and the fan noise is very low, hard drive temperatures are about 37\u2103. In the summer it may be louder and hotter.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"82\" src=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-16.png\" alt=\"\" class=\"wp-image-331\" srcset=\"https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-16.png 363w, https:\/\/www.ddzheng.cc\/wp-content\/uploads\/2022\/10\/image-16-256x58.png 256w\" sizes=\"auto, (max-width: 363px) 100vw, 363px\" \/><\/figure>\n\n\n\n<p>I don&#8217;t have multi-gig infrastructure at home so I&#8217;m using my GbE connection for now. In the future I may upgrade my network system to multi-gig or directly to 10G.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I built a NAS with a cursed motherboard and TrueNAS Scale<\/p>\n","protected":false},"author":1,"featured_media":315,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[7,22,14,10],"class_list":["post-291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-hw","tag-server","tag-software","tag-writeup"],"_links":{"self":[{"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291"}],"version-history":[{"count":7,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/291\/revisions"}],"predecessor-version":[{"id":365,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/291\/revisions\/365"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=\/wp\/v2\/media\/315"}],"wp:attachment":[{"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ddzheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}