[SOLVED] Firmware recovery from DOM partition deletion

Questions about SNMP, Power, System, Logs, disk, & RAID.
0verdrive
First post
Posts: 1
Joined: Tue Sep 02, 2014 9:42 pm

[SOLVED] Firmware recovery from DOM partition deletion

Post by 0verdrive » Tue Sep 02, 2014 11:15 pm

I thought I'd write this report of an issue I recently had, along with how I recovered, in case anyone else finds themselves in a similar position in the future.

I recently purchased a TS-469L, and while I was waiting for my hard drives to arrive in the mail, decided to throw some old drives in to familiarize myself with the settings. I initialized the system with Raid 1 on the old drives, and played with various settings until I felt comfortable with how everything was set up. At that point, I wanted to change my Raid 1 setup to Raid 5, so that (once I had my new drives) I could just swap them out and upgrade the raid size. However, I couldn't remove the volumes that had been created - the web interface reported an error when it attempted to remove any of the Raid 1 volumes that I'd created. I searched online, and found a suggestion that I could ssh into the box and use fdisk to remove the partitions of the drives, which should set the box back to it's pre-initialized state. Unfortunately, since I'm new to QNAP I didn't realize that (at least on the 469L) /dev/sda is the DOM! So I removed the DOM partitions, in addition to the partitions on the installed drives. (I know - it was a pretty stupid mistake, but I blame unfamiliarity with the system. ;) ) As you can guess, once I rebooted, I was stuck with what appeared to be an expensive brick! I searched online for various solutions, none of which worked fully - but after several hours of troubleshooting, I was able to cobble together a solution that I thought might be useful for others.

The first page I found was qnap's Firmware recovery page (links below). As instructed, I pulled my hard drives, built a bootable D*mn Small Linux thumbdrive, and attempted to boot from the USB drive as instructed. But for some reason, I never did get boot options when pressing F11 while booting - instead it took me to an EFI shell that seemed pretty limited in what I could do. After a bit of trial/error, I found that my usb drive wasn't bootable as expected, and I found better results using Pendrive's USB installer to make a bootable USB drive. (It may be unrelated, but I also found that by sticking the USB drive in the USB-3.0 slots, the NAS would opt to boot from USB automatically, and I didn't need to press F11 to select a boot drive.) Unfortunately, when I tried recovering the firmware with DSL I had two problems: first, the keyboard failed to initialize (despite working prior to booting.) Second, it would time out while autoconfiguring devices, giving me an error that the configuration failed and that I should check bios. At that point (without a working keyboard) I was pretty much stuck. Eventually, I decided to use a 32-bit Ubuntu Desktop Live image, which booted fine. I didn't have a mouse connected to the NAS, but I was able to hit Ctrl-Alt-F2 to get to a command prompt, which was all I needed. After verifying that the image would boot, I powered the unit back down, pulled the USB drive and also copied the full (factory test version 1.x.x) image onto the thumb drive. I then booted into Ubuntu again, and used "dd" to write the full image to /dev/sda, which recreated the partitions and made the device bootable again.

Code: Select all

dd if=/cdrom/F_TS-469_20140516-1.2.8.img of=/dev/sda
# (Note that if anyone else uses this approach, the source location of the factory image will vary, depending on your ISO.)


I then pulled the USB drive and rebooted, and was happy to see the NAS boot as expected. Even better, QFinder could now find it on the network! Unfortunately, my happiness was short-lived. As outlined in the firmware recovery page, the full image is a factory test image, which can't provision the external hard drives, and needs to be updated to offically released firmware. However, QFinder failed when attempting to update the firmware, and I ended up needing to manually update it myself. After much trial/error, I believe that the failure was due to the fact that /mnt/HDA_ROOT was unmounted (without any drives to mount) and there wasn't enough space on the DOM to copy the official firmware into place prior to upgrading. I resolved this by following a portion of the "Manually Updating Firmware" page, taking the following steps:

Code: Select all

# Copy official firmware onto USB thumb drive (root directory)
# Insert thumb drive into (already running) QNAP box
# Use dmesg and fdisk -l /dev/sd* to determine which device was my thumb drive - in my case /dev/sde1

mkdir /mnt/HDA_ROOT/update
rm -rf /mnt/update
ln -sf /mnt/HDA_ROOT/update /mnt/update
mount /dev/sde1 /mnt/HDA_ROOT/update
/etc/init.d/update.sh /mnt/HDA_ROOT/update/TS-469_20140612-4.1.0.zip

# **remove usb thumbdrive**
reboot


At some point during this process, my thumb drive got wiped somehow. Not sure what happened, but it wasn't a big deal, I just used putty's psftp to copy the official firmware to the already mounted USB thumb drive on the NAS, and proceeded with the steps above. My biggest mistake at this point was forgetting to remove the USB drive before rebooting. Because it had been wiped, but was still bootable, the NAS tried to boot from the thumb drive, and failed, making it look like the last firmware upgrade had bricked my NAS again. At that point, I went back to the first step and repeated the entire procedure - it wasn't until later that I realized that my NAS was fine and I cost myself another hour or so of troubleshooting because I left my thumb drive in when rebooting. :S

Anyway, I hope this writeup will help someone else out in the future. The recovery can be done relatively quickly if you know where to find all the necessary tools and images, and if you can figure out how to pull the various instructions together to resolve issues along the way. I've included links below to all the tools and images I used - anyone not using a 469L will obviously need firmware specific to their device, but this approach should help if you find yourself without a DOM partition.

Firmware Recovery Guide for x86-based NAS
Manually Updating Firmware
TS-469L Full Image (Version 1.x.x => Factory Test)
Official Updated Firmware
Pendrive Universal USB Installer
32-bit Ubuntu Desktop Live ISO
Putty PSFTP

User avatar
doktornotor
Ask me anything
Posts: 7519
Joined: Tue Apr 24, 2012 5:44 am

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by doktornotor » Tue Sep 02, 2014 11:22 pm

Cool first post! Welcome to the forum! :geek: :ubergeek: 8)
I'm gone from this forum till QNAP stop wasting volunteers' time. Get help from QNAP helpdesk instead.
Warning: offensive signature and materials damaging QNAP reputation follow:
QNAP's FW security issues
QNAP's hardware compatibility list madness
QNAP's new logo competition
Dear QNAP, kindly fire your clueless incompetent forum "admin" And while at it, don't forget the webmaster!

darth_max
New here
Posts: 4
Joined: Tue Aug 23, 2011 6:44 pm
Location: Vienna, Austria

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by darth_max » Mon Sep 08, 2014 8:32 am

8) This post saved my Day! Or maybe better my night! :roll:

Only one thing for TS-1079 Pro and TS-1270 U Users (maybe other models based on these Plattforms also): You have to unzip the img File direct to the USB Root Folder. Otherwise the box came up with:

Code: Select all

[~] # /etc/init.d/update.sh /mnt/HDA_ROOT/update/TS-1270U_20140612-4.1.0.zip
cksum=3210660901
Check RAM space available for FW update: OK.
Using 120-bit encryption - (QNAPNASVERSION4)
sig: >
 icpnas
[Firmware Upgrade] System update failed. Firmware file format error. Error code: FW004

kachijs
New here
Posts: 9
Joined: Thu Oct 08, 2015 10:38 pm

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by kachijs » Sun Oct 25, 2015 4:13 am

Hello. i have the same problem. I also accidentally wiped DOM partitions. i have no partitions on /dev/sda

I have TS-251 and i tried your method, but without luck. Maybe im not using factory firmware ?

User avatar
pwilson
Guru
Posts: 22569
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by pwilson » Sun Oct 25, 2015 10:24 am

Try Firmware image: F_TS-X51_20140916-1.2.8.img.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.

kachijs
New here
Posts: 9
Joined: Thu Oct 08, 2015 10:38 pm

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by kachijs » Sun Oct 25, 2015 4:52 pm

Yes Patrick this was my second problem (At first i used 4.2.0 firmware unpacked from zip file), but then i downloaded this factory's firmware for x51 system (It was twice the size of 4.2.0). Following this guide by copying img to /dev/sda it created partitions and booted up my NAS. I however was able to update to 4.2.0 through Qfinder and didnt have to perform manual upgrade steps.

Mark Howard
New here
Posts: 2
Joined: Mon Oct 26, 2015 2:27 am

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by Mark Howard » Mon Oct 26, 2015 2:40 am

Hello group. First post. While this post is closed, this is somewhat my issue. I have a VS-4016 pro with corrupt firmware... after exhausting efforts to restore via every forum method found (literally 100+ hours), I decided to write the factory image for the TS-459 to my VS-4016. Surprisingly, I am able to now boot and connect to the device. However, every attempt to write the correct VS-4016 firmware or even the user firmware for the TS-459 fails. Have tried terminal commands, admin web page and via Qfinder. Would anyone happen to have the complete image or factory image for the VS-4016? Would anyone happen to have any other suggestions. While I'm a noob to Linux, in the last 100+hours working on this stubborn beast has proven invaluable. Thank you much! - Mark (Savannah, GA)

Mark Howard
New here
Posts: 2
Joined: Mon Oct 26, 2015 2:27 am

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by Mark Howard » Wed Oct 28, 2015 7:12 am

Responding under my own post. <SOLVED FINALLY> Thank you Overdrive, your original post help the most. Not a journey I would want to enbark on again anytime soon, but the education and satisfaction of figering something out ourselves is priceless!

leroy1980
New here
Posts: 6
Joined: Tue Feb 22, 2011 4:52 pm

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by leroy1980 » Thu Dec 17, 2015 2:57 am

Great mate. This is the only solution that worked.
Thanks

rabbivj
New here
Posts: 3
Joined: Mon Mar 28, 2016 3:24 am

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by rabbivj » Mon Mar 28, 2016 9:50 am

I ran into the same problem today and this pretty much solved my problem as well.

hendo3000
New here
Posts: 3
Joined: Mon Jul 04, 2016 10:01 pm

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by hendo3000 » Fri Jul 22, 2016 9:56 pm

This thread should be the top post on google for qnap firmware, it needs more keywords. I toiled with the qnap wiki telling to use a ps2 mouse and vga monitor with DSL forever until I found this post.

Thanks so much for the excellent tutorial!

90Ninety
Know my way around
Posts: 148
Joined: Mon Jun 27, 2016 7:00 pm

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by 90Ninety » Mon Oct 17, 2016 7:20 am

Does anyone know how to clone the DOM drives?

I got a blank replacement DOM drive , I connected a usb fly lead to it and tried many different cloning softwares on Windows , nothing works ( tried Easus Backup / Clonezilla)

Next I will try Acronis and DD in Linux

userking88
Starting out
Posts: 13
Joined: Tue Jan 31, 2017 3:41 am

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by userking88 » Tue Jun 06, 2017 1:27 am

after the very first steps dd if=/cdrom/F_TS-469_20140516-1.2.8.img of=/dev/sda

i see after a reboot testu43503 login:
is this a right output ? its a black windows. or is there something wrong ?


i get error after using
/etc/init.d/update.sh /mnt/HDA_ROOT/update/dom.img
[Firmware Update] System update failed. Error code: FW001

i unziped the firmware and got the image and rewrite it to dom.img

so what can i do now ??? is it normal that the codes before get no output ??? i mean there is nothing noticed after i use the code snippeds

may i use some wrong order structure ?? or is this always the same

User avatar
schumaku
Guru
Posts: 43663
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by schumaku » Tue Jun 06, 2017 2:15 am

userking88 wrote:i unziped the firmware and got the image and rewrite it to dom.img
Please stick exactly with what is documented in the QNAPedia ...

userking88
Starting out
Posts: 13
Joined: Tue Jan 31, 2017 3:41 am

Re: [SOLVED] Firmware recovery from DOM partition deletion

Post by userking88 » Tue Jun 06, 2017 2:19 am

dont understand what you mean


i added some images i have now used without change file name
You do not have the required permissions to view the files attached to this post.
Last edited by userking88 on Tue Jun 06, 2017 2:37 am, edited 1 time in total.

Post Reply

Return to “System & Disk Volume Management”