Personal Data Preservation Plan: (4) Basic Environment Configuration
Disable swap If you have enough memory (8GB or more), you can consider disabling swap to improve system performance Check which swaps are enabled cat /proc/swaps Output | Filename | Type | Size | Used | Priority | | ------------------------------------- | ----
目录7 个章节
Disable swap
If you have enough memory (8GB or more), you can consider disabling swap to improve system performance
Check which swaps are enabled
cat /proc/swaps
Output
| Filename | Type | Size | Used | Priority |
|---|---|---|---|---|
| /dev/md321 | partition | 8283708 | 2373820 | -2 |
| /dev/md256 | partition | 530108 | 0 | -3 |
| /dev/md322 | partition | 7235132 | 0 | -4 |
| /share/CACHEDEV1_DATA/.swap/qnap_swap | file | 16777212 | 0 | -5 |
Disable all swaps at once
swapoff -a
However, because QNAP's system directories are read-only, they will still be turned back on after the next reboot, so the change is only effective during the current boot session
You can turn them back on manually; just specify the corresponding swap to enable.
swapon /dev/md321
swapon /dev/md256
Add third-party sources
Currently there are two options: one is Europe's QNAP Club, and the other is the Entware package manager.
QNAP Club
This can be managed and installed directly in App Center
Click the gear button in the upper right corner of App Center, go to the "App Repository" tab, click Add, set a name—I just set it to QNAP Club—paste in the following URL, and confirm
https://www.qnapclub.eu/repo.xml
After adding it, an extra icon will appear in the left sidebar of App Center, with the name you just set
Clicking into it should be completely blank; click All Apps. Because its servers are in Europe, it will take a while before they show up~
After trying it out, I found this quite convenient. There are many more packages than the official ones (though of course not as many as Entware). The download speed is slow, but still acceptable
Entware
This is a package manager, similar to Brew on Mac. After installation, you can use it from the command line. It can be used to install a lot of software that QNAP's customized Linux doesn't include, such as git, openssh, and the like.
Entware itself is an open-source project that can be installed on embedded devices such as routers. Officially it also provides support for QNAP NAS, offering installation packages in qpkg format.
Entware installs all software under /opt, so its command is opkg
There are several ways to download it:
- Official GitHub Release: https://github.com/Entware/Entware
- The QNAP Club mentioned above; just go in and search
- Entware website: http://bin.entware.net/other/Entware_1.03std.qpkg
Official wiki: https://github.com/Entware/Entware/wiki/Install-on-QNAP-NAS
The latest version is currently 1.03. After downloading, open App Center, click Manual Install in the upper right corner, upload the package and install it. Oh, you need to enable unknown digital signatures in the settings first.
When I installed it, it kept getting stuck at 45%. I closed App Center, reopened it, canceled the installation, and after repeating this several times I finally got it installed. After searching for a long time I think it was probably a network issue in China. App Center doesn't show command-line output during installation, which is really a hassle—when something goes wrong you don't even know where to look.
PS: I now know you can install software directly with sh xxx.qpkg.
After installation, running opkg gives command not found
You still need to add the path to the PATH environment variable
Edit ~/.bashrc
export PATH=/opt/bin:$PATH
Then run source ~/.bashrc to take effect
It seems you have to do this every time you log in via ssh. Not sure if there's any other solution
A few commonly used commands:
opkg updateupdate sourcesopkg upgradeupgrade installed softwareopkg install 包名install softwareopkg remove 包名remove softwareopkg list | grep -e 包名search for software
References
- Installing Entware on QNAP - https://blog.phpgao.com/qnap_install_entware.html
- QNAP Tinkering Part 1: Installing QNAP qpkg packages from the command line - https://einverne.github.io/post/2018/06/qnap-install-qpkg-from-command-line.html
Rants (from the referenced blogger)
- After installing python3, perl, and nodejs in App Center, they are also missing from the environment variables, so you also need to manually add these three programs to the environment variables;
- QNAP's customized Linux is really a hassle; /usr/bin gets reset, and it's not the only directory that gets reset;
Blog references
- My Home Server Journey - https://blog.csdn.net/hanziyuan08/category_9817235.html
- The same author's GitHub blog - https://github.com/Bpazy/blog/issues
- Playing with QNAP Column - https://post.smzdm.com/xilie/73788/
_EOF_
Personal Data Preservation Plan: (4) Basic Environment Configuration
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
为什么我给虚拟机分了 32G 硬盘,Ubuntu 却只识别 16G?
32G硬盘在PVE里明明分配好了,到Ubuntu就变15G,LVM这鬼东西把空间藏哪儿去了?根目录就分了一半?这算哪门子逻辑,简直离谱。扩容三步走倒是简单,但谁特喵会用到这种坑爹设计。
2025-10-10 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:安装docker
快速开始 App Center 中安装 Container Station 然后建议先在 FileStation 里自行创建一个 Container 文件夹,这样可以控制要在哪个卷上保存 docker 的数据,我是放在固态盘上。 安装后第一次打开会提示创建 Container 共享文件夹,直接选之前创建好的 Container 目录就行。 然后全部回归命令行 默认自带 docker-compose
2022-11-13 · 个人数据保全计划 · 约 1 分钟
PVE折腾笔记 (1) 告别卡顿的QTS,在威联通TS464c上安装PVE系统
QNAP 的 QTS 系统真是垃圾中的垃圾,臃肿不堪还拖慢速度。换个 PVE 系统立马飞起,纯净高效,性能和自由度直接拉满。折腾安装过程虽然繁琐,但结果绝对物超所值,NAS 升级服务器只需一步。
2025-06-15 · 个人数据保全计划 · 约 1 分钟
PVE折腾笔记 (2) 挂载之前在QNAP里使用的硬盘
QNAP硬盘数据迁移真够折腾的,RAID、DRBD、LVM层层嵌套,读出来比解方程还难。mdadm能识别但挂载失败,还得激活LVM才能看到文件,这坑比啥玩意儿。直接重做系统最省事,留原方案也行但风险不小,QTS的鸡贼设计简直让人想砸机器。
2025-06-15 · 个人数据保全计划 · 约 1 分钟
讨论
共 0 条加载评论中…