Tuesday, January 21, 2020

QNAP NAS - Error FW003 when trying to update firmware

Have you received error FW003 when trying to update the firmware of your QNAP Network Attached Storage (NAS)?
You have found the right page!
 
If you encounter error FW003 when trying to update the firmware of your QNAP NAS, it means that the system disk partition (which is used by the NAS to actually work and is separated from the actual storage space) does not have enough free space to perform the update operations. For example, if the size of the new version of the firmware is 185 MB and the available space is only 180 MB, you will get this error.
 
The only way to solve is to free enough disk space to perform the update. To do this you will have to connect to the NAS via SSH (using PuTTY on Windows, or a terminal on Linux/MacOS), and start looking for files that can be sacrificed to make room for the update.
 
To achieve this, once connected to the NAS via SSH, you will have to perform the following operations:
 
  1. Confirm you have not enough free space on the system disk by issuing this command:

    [~] # df

    You'll get an output like the following:


    You have to check the column "Mounted on" and find "/mnt/HDA_ROOT". Check if available space is effectively smaller than the firmware update package. If so, go on. If not, contact QNAP support.

  2. Confirm no /mnt/update file or folder and no /tmp/update_process file exist: if they exist, you need to delete them using:

    [~] # rm -rf /mnt/update
    [~] # rm -f /tmp/update_process
     
  3. Repeat step 1. If available space on /mnt/HDA_ROOT is now larger than needed, proceed with the firmware update. If available space on /mnt/HDA_ROOT is still smaller than needed, proceed to Step 4.
     
  4. Now you will have to look for the files that are occupying too much space on your /mnt/HDA_ROOT partition. This is different for every system, so there is not a unique solution. It's basically trial-and-error. Start with:

    [~] # ls -als /mnt/HDA_ROOT/

    To get the list of directories on this partition. Now check every directory using the following command:

    [~] # ls -als /mnt/HDA_ROOT/directoryname

    where directoryname stands for each directory (and their subdirectories) on the partition. My suggestion: start with the .logs and lost+found directories. For example:

    [~] # ls -als /mnt/HDA_ROOT/.logs

    You might get something like this:
    -rw-r--r-- 1 admin administ 184.7M Jan 21 2020 conn.log
    -rw-r--r-- 1 admin administ 345.3M Jan 18 2020 event.log
    As you can see those files have become huge, so you can safely delete them (they are log files, so not needed by the system) using the command:

    [~] # rm -f /mnt/HDA_ROOT/.logs/conn.log
    [~] # rm -f /mnt/HDA_ROOT/.logs/event.log

    As specified above, this is just an example. You will have to find the files that actually occupy too much space ON YOUR SYSTEM.
     
  5. Once deleted these files, and freed up enough space, proceed with the firmware update as usual.