QNAP NAS固件更新失败的手工处理
公司某部门有一QNAP的小型NAS,近日尝试更新固件,提示FW004错误。
多次在web上尝试升级,并尝试升级至不同版本,均不凑效,偶尔会蹦出FW999错误。
*,Google一下,在QNAP官网找到答案。
官网上并未解释造成固件升级失败的原因,但提供了手动升级固件的方法,具体如下:
(0)从QNAP官网下载固件,验证文件的MD5,并解压缩为img文件。然后将文件上传到NAS的共享中(比如public目录)
(1)用telnet/ssh登录NAS,检查/mnt/HDA_ROOT/update目录是否存在,如有必要则创建目录
# mkdir /mnt/HDA_ROOT/update
(2)确保不存在/mnt/update和/tmp/update_process两个目录,如果有则删除
# rm -rf /mnt/update
# rm -f /tmp/update_process
(3)请勿将升级软件(img文件)移动到HDA_ROOT/update,否则可能会出现错误提示:“System update failed. No enough space on RAM/ disk available for firmware update.”。仅在当前目录下建立一个副本就可以了(副本名称以work.img为例)。
提示:制作副本的原因,是因为执行升级脚本后,升级用的img文件会被删除。
# cp /share/Public/TS-131P_231P_431P_X31+_20190308-4.3.6.0875.img /share/Public/work.img
(4)创建到/mnt/update的链接
# ln -sf /mnt/HDA_ROOT/update /mnt/update
(5)运行升级脚本
# /etc/init.d/update.sh /share/Public/work.img
运行升级脚本后,你会得到一些类似的输出,如下:
cksum=2605584673
UBI device number 1, total 1728 LEBs (219414528 bytes, 209.2 MiB), available 1720 LEBs (218398720 bytes, 208.3 MiB), LEB size 126976 bytes (124.0 KiB)
Set volume size to 218398720
Volume ID 0, size 1720 LEBs (218398720 bytes, 208.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "tmp", alignment 1
Using 120-bit encryption - (QNAPNASVERSION4)
len=1048576
model name = TS-X41
version = 4.3.6
IS_STORAGE_V2
TS131P_u-boot.bin
TS131P_u-boot.bin.cksum
TSX31P+_u-boot.bin
TSX31P+_u-boot.bin.cksum
TSX41_u-boot.bin
TSX41_u-boot.bin.cksum
boot/
config/
eeprom_1.38_AL212-1700_OB_1G_V2.bin
eeprom_1.38_AL212-1700_OB_1G_V2.bin.cksum
eeprom_1.39_AL212-1400_OB_1G.bin
eeprom_1.39_AL212-1400_OB_1G.bin.cksum
fw_info
fw_info.conf
i2cget
i2cset
libcrypto.so.1.0.0
libssl.so.1.0.0
rootfs2.ubi
rootfs2.ubi.cksum
u-boot.bin
u-boot.bin.cksum
uImage
uImage.cksum
update/
update_img.sh
4.3.6 20190308
MODEL NAME = TS-X41,new version = 4.3.6
limit version = 4.3.4
new buildnum = 2019/3/8
limit buildnum = 2018/3/30
Allow upgrade
Allow upgrade
/mnt/HDA_ROOT/update
2019-03-11 23:27:13 === Match: TS-431+: boot img is TSX41_u-boot.bin
2019-03-11 23:27:13 cksum: u-boot.bin ...ok
2019-03-11 23:27:14 img_ver=1.73.4
2019-03-11 23:27:14 Image Boot Ver: 1.73.4
2019-03-11 23:27:14 b_ver=1.73.4
2019-03-11 23:27:14 Nas Boot Ver: 1.73.4
2019-03-11 23:27:14 the latest bootloader
2019-03-11 23:27:14 === Match: TS-431+: preloader img is eeprom_1.39_AL212-1400_OB_1G.bin
2019-03-11 23:27:14 cksum: eeprom_1.39_AL212-1400_OB_1G.bin ...ok
2019-03-11 23:27:14 === Check Preloader Status
2019-03-11 23:27:19 /tmp/eeprom_1.39_AL212-1400_OB_1G.bin.new.hex: cksum is 2289290801
2019-03-11 23:27:19 /tmp/preloader.old.hex: cksum is 2289290801
2019-03-11 23:27:19 Info: No need to update preloader
2019-03-11 23:27:19 === Latest preloader version
2019-03-11 23:27:19 Check CRC
2019-03-11 23:27:19 cksum: uImage ...ok
2019-03-11 23:27:20 cksum: rootfs2.ubi ...ok
2019-03-11 23:27:20 Update uImage(Kernel + initrd.boot) to Recovery Partition
2019-03-11 23:27:20 erase nand (mtd4)
2019-03-11 23:27:21 write nand (mtd4)
2019-03-11 23:27:28 Update rootfs2.ubi
2019-03-11 23:27:28 write nand (mtd5)
2019-03-11 23:28:23 Update uImage(Kernel + initrd.boot) to Main Partition
2019-03-11 23:28:23 erase nand (mtd2)
2019-03-11 23:28:23 write nand (mtd2)
2019-03-11 23:28:30 Update Rootfs2.ubi
2019-03-11 23:28:30 write nand (mtd3)
2019-03-11 23:29:25 Update Finished
/share/CACHEDEV1_DATA
set cksum [2605584673]
(6)看到最后提示“Update Finished”而没有错误产生,就是升级成功了。执行命令重启NAS即可。
提示:重启需要花费约十几分钟,并且在重启前&后会有数分钟的“可ping通,但无法登录WEB/Telnet/SSH”的状态。
# reboot
参考来源:
[1]Manually Updating Firmware, QNAP Wiki, https://wiki.qnap.com/wiki/Manually_Updating_Firmware
[2]What to do if firmware update failed, QNAP Wiki, https://wiki.qnap.com/wiki/What_to_do_if_firmware_update_failed
推荐阅读