User Tools

Site Tools


hw:qnap

QNAP

Edit crontab

DO NOT edit via “crontab -e” changes will be overwritten after a reboot.

# vi /etc/config/crontab
# crontab /etc/config/crontab

To check if running crontab was updated:

# crontab -l

Enable SSH TCP Forwarding

Set config:

setcfg LOGIN "SSH AllowTcpForwarding" TRUE

sshd have to be restarted. On QNAP /etc/init.d/login.sh is used for sshd restarts (includes also telnet). If login.sh is restarted, the stop procedure is executed, which kills the daemon including all sessions. If it is restarted over ssh, the session will be killed without starting ssh again. Use nohup (Entware coreutils-nohup package) or tmux/screen to successfully restart the deamon.

Check if settings are set and active:

getcfg LOGIN "SSH AllowTcpForwarding"
grep "^AllowTcpForwarding" /etc/config/ssh/sshd_config

Resize over 16TB

I once ran into the problem, that I couldn't extend my volume over 16TB. I didn't know why, but I had to recreate it with a bigger size and it worked.

The problem is shallowly described here: QNAP KB: 16TB Storage Limitation

They say, you can extend the volume over 16TB if you created the volume with firmware 4.4.3 or later but they don't say, how to figure that out.

So, what's the reason for this limit? It's the file system. The maximum number of blocks on ext4 was 2^32 (4294967296). Let's figure out, in what size this results.

Check the block size.

[~] # tune2fs -l /dev/mapper/cachedev1 | grep "^Block size:"   
Block size:               4096

4096 means 4096 bytes.

Let's multiply this with the maximum number of blocks (2^32) and get the size in tera bytes.

>>> (2**32)*4096/1024**4
16.0

16TB is the maximum size of an ext4 file system with a block size of 4KB. But why can you delete the volume and create it with a bigger size than 16TB?

Let's check the filesystem features of the newly created volume.

[~] # tune2fs -l /dev/mapper/cachedev1 | grep "^Filesystem features:"   
Filesystem features:      has_journal ext_attr filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize

The relevant feature is “64bit”.

https://man7.org/linux/man-pages/man5/ext4.5.html

64bit: Enables the file system to be larger than 2^32 blocks.

This file system feature wasn't available in the kernel versions before firmware versions before 4.4.3.

hw/qnap.txt · Last modified: 2021-11-29 00:16 by Manuel Frei