The main firmware is stored on the DOM. It contains the bare minimum to boot and setup the machine without disks, plus some tarballs containing apps, system utilities and services that get installed to disk once at least one disk is initialized.
MBR partitions on a 512 MB DOM:
1 ext2 5 MB contains boot loader
2 ext2 235 MB contains kernel image, root filesystem image, tarballs for add-ons to be installed to disk
3 ext2 235 MB copy of #2. This is what QNAP refers to by "Dual boot OS protection" in its products specs. It would have been more useful IMHO to put a recovery firmware here that never gets updated than simply an identical copy of the latest firmware.
4 --- Extended partition (needed for more than 4 partitions with MBR)
5 ext2 8 MB purpose unknown. On my NAS, it contains a single, empty 'qlicense' directory. On a running system, this partition is mounted at /mnt/boot_config. It might be used to store passphrases or keys to automatically unlock encrypted drives if this feature is used.
6 ext2 8 MB grab-bag of a few configuration files that appear to be only stored here during a firmware update. Also contains autorun.sh if you use one.
Once there is at least one disk initialized, two md RAID1 devices are setup to store extra software that's part of the firmware, and to store configuration and logs, respectively:
- md9 (array of /dev/sdX1 partition(s)) ext3 ~500 MB mounted at /mnt/HDA_ROOT contains configuration in (hidden) .config directory, and logs in (hidden) .logs directory, and various other bits. Most logs are sqlite databases that need to be dumped before they can be read, except the kernel log kmsg which is plain text.
- md13 (array of /dev/sdX4 partition(s)) ext3 ~400 MB mounted at /mnt/ext contains the remainder of the firmware installed from the DOM tarballs.
Finally yet more pieces of the "firmware", such as the stupid Multimedia Console and Help Desk apps which can't be removed, are installed in the form of QPKG on the system volume in the (hidden) .qpkg directory. If the system volume is stored on the first storage pool, it would be in /share/CACHEDEV1_DATA/.qpkg.
Jens2 wrote: ↑Wed Mar 10, 2021 4:56 pm
In general - do you know how the firmware and settings are stored?
See above. I used my NAS as a reference, yours works probably the same way with an X86 CPU and the same DOM size, but things may be quite different on newer models equipped with much larger DOMs.
And is this DOM used for logs as well?
No stateful information ever gets stored to the DOM while the NAS is running, even when there are no disks, it's used purely as a readonly boot device. It only gets written to for firmware updates. When the system is booted off the DOM and there are no initialized disks, it runs entirely from RAM and all system state data is lost at power-off or reboot.
Information provided for informational purpose only and not intended to be an exhaustive inventory of QNAP firmware's scattered mess. I wouldn't recommend you attempt to backup and restore any of it. Heck, even QNAP themselves don't dare offering a 'System backup/restore' feature to their users!