{"id":2893,"date":"2015-05-30T15:00:05","date_gmt":"2015-05-30T05:00:05","guid":{"rendered":"https:\/\/www.penguinpunk.net\/blog\/?p=2893"},"modified":"2015-06-18T15:57:51","modified_gmt":"2015-06-18T05:57:51","slug":"qnap-upgrading-firmware-via-the-cli","status":"publish","type":"post","link":"https:\/\/www.penguinpunk.net\/blog\/qnap-upgrading-firmware-via-the-cli\/","title":{"rendered":"QNAP &#8211; Upgrading Firmware via the CLI"},"content":{"rendered":"<p>For some reason, I keep persisting with my QNAP TS-639 II, despite the fact that every time something goes wrong with it I spend hours trying to revive it. In any case, I recently had an issue with a disk showing SMART warnings. I figured it would be a good idea to replace it before it became a big problem. I had some disks on the shelf from the last upgrade. When I popped one in, however, it sent me\u00a0this e-mail.<\/p>\n<pre><strong>Server Name: qnap639<\/strong>\r\n<strong>IP Address: 192.168.0.110<\/strong>\r\n<strong>Date\/Time: 28\/05\/2015 06:27:00<\/strong>\r\n<strong>Level: Warning<\/strong>\r\n<strong>The firmware versions of the system built-in flash (4.1.3 Build 20150408) and the hard drive (4.1.2 Build 20150126) are not consistent. It is recommended to update the firmware again for higher system stability.<\/strong><\/pre>\n<p>Not such a great result. I ignored the warning and manually rebuilt the \/dev\/md0 device. When I rebooted, however, I still had the warning. And a missing disk from the md0 device (but that&#8217;s a story for later). To get around this problem, it is recommended that you reinstall the array firmware via the shell. I took my instructions from <a href=\"http:\/\/wiki.qnap.com\/wiki\/Manually_Updating_Firmware\" target=\"_blank\">here<\/a>. In short, you copy the image file to a share, copy that to an update directory, run a script, and reboot. It fixed my problem as it relates to that warning, but I&#8217;m still having issues getting a drive to join the RAID device. I&#8217;m currently clearing the array again and will put in a new drive next week. Here&#8217;s what it looks like when you upgrade the firmware\u00a0this way.<\/p>\n<pre><strong>[\/etc\/config] # cd \/\r\n<\/strong><strong>[\/] # mkdir \/mnt\/HDA_ROOT\/update\r\n<\/strong><strong>mkdir: Cannot create directory `\/mnt\/HDA_ROOT\/update': File exists\r\n<\/strong><strong>[\/] # cd \/mnt\/HDA_ROOT\/update\r\n<\/strong><strong>[\/mnt\/HDA_ROOT\/update] # ls\r\n<\/strong><strong>[\/mnt\/HDA_ROOT\/update] # cd \/\r\n<\/strong><strong>[\/] # cp \/share\/Public\/TS-639_20150408-4.1.3.img \/mnt\/HDA_ROOT\/update\/\r\n<\/strong><strong>[\/] # ln -sf \/mnt\/HDA_ROOT\/update \/mnt\/update\r\n<\/strong><strong>[\/] # \/etc\/init.d\/update.sh \/mnt\/HDA_ROOT\/update\/TS-639_20150408-4.1.3.img\u00a0\r\n<\/strong><strong>cksum=238546404\r\n<\/strong><strong>Check RAM space available for FW update: OK.\r\n<\/strong><strong>Using 120-bit encryption - (QNAPNASVERSION4)\r\n<\/strong><strong>len=1048576\r\n<\/strong><strong>model name = TS-639\r\n<\/strong><strong>version = 4.1.3\r\n<\/strong><strong>boot\/\r\n<\/strong><strong>bzImage\r\n<\/strong><strong>bzImage.cksum\r\n<\/strong><strong>config\/\r\n<\/strong><strong>fw_info\r\n<\/strong><strong>initrd.boot\r\n<\/strong><strong>initrd.boot.cksum\r\n<\/strong><strong>libcrypto.so.1.0.0\r\n<\/strong><strong>libssl.so.1.0.0\r\n<\/strong><strong>qpkg.tar\r\n<\/strong><strong>qpkg.tar.cksum\r\n<\/strong><strong>rootfs2.bz\r\n<\/strong><strong>rootfs2.bz.cksum\r\n<\/strong><strong>rootfs_ext.tgz\r\n<\/strong><strong>rootfs_ext.tgz.cksum\r\n<\/strong><strong>update\/\r\n<\/strong><strong>update_img.sh\r\n<\/strong><strong>4.1.3 20150408\u00a0\r\n<\/strong><strong>OLD MODEL NAME = TS-639\r\n<\/strong><strong>Allow upgrade\r\n<\/strong><strong>Allow upgrade\r\n<\/strong><strong>\/mnt\/HDA_ROOT\/update\r\n<\/strong><strong>1+0 records in\r\n<\/strong><strong>1+0 records out\r\n<\/strong><strong>tune2fs 1.41.4 (27-Jan-2009)\r\n<\/strong><strong>Setting maximal mount count to -1\r\n<\/strong><strong>Setting interval between checks to 0 seconds\r\n<\/strong><strong>Update image using HDD ...\r\n<\/strong><strong>bzImage cksum ... Pass\r\n<\/strong><strong>initrd.boot cksum ... Pass\r\n<\/strong><strong>rootfs2.bz cksum ... Pass\r\n<\/strong><strong>rootfs_ext.tgz cksum ... Pass\r\n<\/strong><strong>rootfs_ext.tgz cksum ... Pass\r\n<\/strong><strong>qpkg.tar cksum ... Pass\r\n<\/strong><strong>Update RFS1...\r\n<\/strong><strong>mke2fs 1.41.4 (27-Jan-2009)\r\n<\/strong><strong>Filesystem label=\r\n<\/strong><strong>OS type: Linux\r\n<\/strong><strong>Block size=1024 (log=0)\r\n<\/strong><strong>Fragment size=1024 (log=0)\r\n<\/strong><strong>13832 inodes, 55296 blocks\r\n<\/strong><strong>0 blocks (0.00%) reserved for the super user\r\n<\/strong><strong>First data block=1\r\n<\/strong><strong>Maximum filesystem blocks=56623104\r\n<\/strong><strong>7 block groups\r\n<\/strong><strong>8192 blocks per group, 8192 fragments per group\r\n<\/strong><strong>1976 inodes per group\r\n<\/strong><strong>Superblock backups stored on blocks:\u00a0\r\n<\/strong><strong>8193, 24577, 40961\r\n<\/strong><strong>Writing inode tables: done\r\n<\/strong><strong>Writing superblocks and filesystem accounting information: done\r\n<\/strong><strong>This filesystem will be automatically checked every 21 mounts or\r\n<\/strong><strong>180 days, whichever comes first.\u00a0 Use tune2fs -c or -i to override.\r\n<\/strong><strong>Checking bzImage ... ok\r\n<\/strong><strong>Checking initrd.boot ... ok\r\n<\/strong><strong>Checking rootfs2.bz ... ok\r\n<\/strong><strong>Checking rootfs_ext.tgz ... ok\r\n<\/strong><strong>Update RFS2...\r\n<\/strong><strong>mke2fs 1.41.4 (27-Jan-2009)\r\n<\/strong><strong>Filesystem label=\r\n<\/strong><strong>OS type: Linux\r\n<\/strong><strong>Block size=1024 (log=0)\r\n<\/strong><strong>Fragment size=1024 (log=0)\r\n<\/strong><strong>13832 inodes, 55296 blocks\r\n<\/strong><strong>0 blocks (0.00%) reserved for the super user\r\n<\/strong><strong>First data block=1\r\n<\/strong><strong>Maximum filesystem blocks=56623104\r\n<\/strong><strong>7 block groups\r\n<\/strong><strong>8192 blocks per group, 8192 fragments per group\r\n<\/strong><strong>1976 inodes per group\r\n<\/strong><strong>Superblock backups stored on blocks:\u00a0\r\n<\/strong><strong>8193, 24577, 40961\r\n<\/strong><strong>Writing inode tables: done \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n<\/strong><strong>Writing superblocks and filesystem accounting information: done\r\n<\/strong><strong>This filesystem will be automatically checked every 31 mounts or\r\n<\/strong><strong>180 days, whichever comes first.\u00a0 Use tune2fs -c or -i to override.\r\n<\/strong><strong>1+0 records in\r\n<\/strong><strong>1+0 records out\r\n<\/strong><strong>Update Finished.\r\n<\/strong><strong>Make a Backup\r\n<\/strong><strong>\/share\/MD0_DATA\r\n<\/strong><strong>qpkg.tar cksum ... Pass\r\n<\/strong><strong>set cksum [238546404]\r\n<\/strong><strong>[\/] # reboot\r\n<\/strong><strong>[\/] #\r\n\r\n\r\n<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For some reason, I keep persisting with my QNAP TS-639 II, despite the fact that every time something goes wrong with it I spend hours trying to revive it. In any case, I recently had an issue with a disk showing SMART warnings. I figured it would be a good idea to replace it before [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142,5],"tags":[396,165,110,172,38,800,787],"class_list":["post-2893","post","type-post","status-publish","format-standard","hentry","category-qnap","category-storage","tag-cli","tag-firmware","tag-howto","tag-munted","tag-nas","tag-qnap","tag-storage"],"_links":{"self":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts\/2893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/comments?post=2893"}],"version-history":[{"count":2,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts\/2893\/revisions"}],"predecessor-version":[{"id":2954,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/posts\/2893\/revisions\/2954"}],"wp:attachment":[{"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/media?parent=2893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/categories?post=2893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.penguinpunk.net\/blog\/wp-json\/wp\/v2\/tags?post=2893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}