1

I've just downloaded version 4.3.6 of QNAP QTS operating system. It seems to contain amd64 Linux kernel 4.2.8, initrd and root filesystem, glibc 2.21, Apache 2.4.37, PHP 5.6.38, no Perl, Python 2.7.17rc1, BusyBox 1.24.1, rsync 3.0.7, Bash 3.2.57, tar 1.22, etc., (some of it) compiled with GCC 4.9.2.

Size of the downloaded firmware file is 208 MiB, after full recursive decompression it's 582 MiB, and after compression with 7z it's 148 MiB. (The kernel is 6.88 MiB, the initrd is 15.69 MiB, both compressed.)

Thus to be able to run the QTS operating system, the QNAP device needs storage of at least 582 MiB.

My questions:

  1. Which storage device contains the boot and root filesystems on a QNAP NAS such as TS-251+ when it is running the QTS operating system? Is it one of the SATA HDDs or is there some other internal storage such as a flash (or SSD)? (Please note that I'm interested only in devices which are at least 582 MiB in size, thus a smaller flash containing the bootloader only is not what I'm looking for.)

  2. If I want to install Debian (running natively as a replacement of QTS) to the QNAP NAS TS-251+, can I install it to an internal storage device, and will it boot and run if the NAS contains 0 SATA devices? How much internal storage space will be available for the ext4 boot+root filesystem?

  3. What options do I have to boot Debian from? I guess these: internal storage (if available), SATA HDD or SSD, external USB storage. Are there any other options, such as an extra SD card or non-SATA SSD?

pts
  • 1,041
  • 13
  • 22

2 Answers2

1
  1. QNAPs use a RAM-based root filesystem. Persistent files (such as /etc/passwd) are either copied into the filesystem as part of the boot process or linked back via /etc/config into the Flash based /mnt/HDA_ROOT. It seems to be this /mnt/HDA_ROOT that also contains the QNAP firmware.

    # ls /mnt/HDA_ROOT/update_pkg
    DSv3.tgz           bluetooth.tgz      ldap_server.tgz    musicstation.tgz   samba4.tgz
    ImageMagick.tgz    ffmpeg.tgz         libboost.tgz       photostation2.tgz  vim.tgz
    Python.tgz         helpdesk/          mariadb5.tgz       pkg_flag           vpnopenvpn.tgz
    Samples.tgz        helpdesk.bin*      medialibrary.tgz   printer.tgz        vpnpptp.tgz
    antivirus.tgz      jsLib.tgz          mt-daapd.tgz       qpkg.tar.cksum     wifi.tgz
    avahi0630.tgz      language.tgz       mtpBinary.tgz      radius.tgz
    

    Disk use for the flash disk

    du -hs /mnt/HDA_ROOT/
    144M    /mnt/HDA_ROOT/
    
    df -h /mnt/HDA_ROOT/
    Filesystem                Size      Used Available Use% Mounted on
    /dev/md9                499.5M    144.1M    355.4M  29% /mnt/HDA_ROOT
    

    Other persistent applications are written to the user disks; for example, Entware is installed in the RAM filesystem under /opt but is just symlinked from /share/CE_CACHEDEV1_DATA/.qpkg/Entware/.

  2. No idea

  3. Quite possibly none, depending on whether or not the QNAP is locked to QNAP firmware. (The Fujitsu CELVIN OEM variants are/were locked to Fujitsu-branded QNAP firmware, for example.)

You're probably safer using QNAP software and just side-loading your preferred utilities from Entware.

roaima
  • 107,089
  • 14
  • 139
  • 261
  • Thank you for tryig to help! Many QNAP users had success stories installing Debian (some of them even shared tutorials online) to the hard drives, so your answer to #3 is incorrect. – pts Feb 22 '20 at 13:28
  • About #1: Where are these files stored? On the HDDs? – pts Feb 22 '20 at 13:46
  • 1
    @pts I can't check #1 until Monday at the earliest. My answer #3 is correct, because it depends on whether or not the firmware is locked. You say that QNAP firmware isn't locked, and hat's fine. I've said that the Fujitsu CELVIN was locked. – roaima Feb 22 '20 at 13:54
  • Can you also run `du -h /mnt/HDA_ROOT/` and `df -h /mnt/HDA_ROOT/` so that we can check the total file size (between 208 and 582 MiB) and the size of the flash as well? – pts Feb 25 '20 at 13:48
1

The qnap firmware runs from 'the dom' (diskonmodule), which basically is a usb disk connected directly to the mobo. The ram disk referred to in the first answer is the first stage of the firmware/linux boot. At succesfull boot a pivot root is executed and the operational root will now be located on the hd's system partition. You can flash debian and grub to the dom to boot a vanilla debian or any other linux flavour as long as it fits the dom.

intrax
  • 11
  • 1
  • 1
    On the systems I've used from the past six years up to and including QTS 4.5.1.1456, I don't see this at all: the `/` is always RAM-based. Current samples include TS-253Be, TS-453Be, and older systems such as TS-269L – roaima Nov 21 '20 at 12:51
  • You are right. Should have written 'boots from the dom' ! – intrax Nov 23 '20 at 17:01