Skip to content

Commit 9130c21

Browse files
committed
FEAT: add post laptop fnos
1 parent d347b87 commit 9130c21

File tree

1 file changed

+177
-0
lines changed
  • content/posts/2026-03-07-laptop-fnos

1 file changed

+177
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: "闲置笔记本折腾记录之 fnOS"
3+
date: 2026-03-07T20:58:08+08:00
4+
# weight: 1
5+
# aliases: ["/first"]
6+
tags: ["Server", "System", "DIY"]
7+
author: "Square Zhong"
8+
showToc: true
9+
TocOpen: false
10+
draft: false
11+
hidemeta: false
12+
comments: false
13+
description: "哎,还是折腾。"
14+
canonicalURL: "https://canonical.url/to/page"
15+
disableHLJS: true # to disable highlightjs
16+
disableShare: false
17+
disableHLJS: false
18+
hideSummary: false
19+
searchHidden: false
20+
ShowReadingTime: true
21+
ShowBreadCrumbs: true
22+
ShowPostNavLinks: true
23+
ShowWordCount: true
24+
ShowRssButtonInSectionTermList: true
25+
UseHugoToc: true
26+
cover:
27+
image: "<image path/url>" # image path/url
28+
alt: "<alt text>" # alt text
29+
caption: "<text>" # display caption under cover
30+
relative: false # when using page bundles set this to true
31+
hidden: true # only hide on current single page
32+
editPost:
33+
URL: "https://github.com/squarezhong.github.io/content"
34+
Text: "Suggest Changes" # edit text
35+
appendFilePath: true # to append file path to Edit link
36+
---
37+
38+
## 前言
39+
差不多一年前的这个时候,我在[NAS: 从入坑到入土](https://squarezhong.github.io/posts/2025-04-03-nas-unnecessary/)这篇文章中写下了这样一句话:
40+
> 需求应当被满足,而不是被创造。
41+
42+
那么现在需求回来了,“NAS”也就回来了。
43+
~~其实就是给自己折腾找个理由。~~
44+
45+
本次用于安装 fnOS 的设备为神舟 G7-CT7NA,17寸的究极傻大黑粗,核心配置为 Intel i7-9750h + Nvidia 1660ti,作为 NAS 来说性能功耗比显然是不合格的,不过既然是闲置设备也就不要求那么多了。
46+
47+
这台笔记本有两个 m2 硬盘位和一个 2.5 英寸 SATA 机械硬盘位,安装的存储如下:
48+
- Intel 760p,512G
49+
- Samsung PM9C1A,1TB
50+
- TOSHIBAMQ04ABD200,2TB 叠瓦
51+
## 安装
52+
[官网](https://www.fnnas.com/download)下载镜像后参考[帮助中心 - 飞牛 fnOS](https://help.fnnas.com/articles/v1/start/install-os.md)安装即可。
53+
## fnOS 功能设置
54+
### 存储空间管理
55+
按需自行创建存储空间,因为我三块硬盘的容量都不一样,所以直接建了 Baisc 分区。如果有重要数据请务必使用 RAID。
56+
### 远程访问
57+
由于暂时没有该需求,加上可能的安全性问题(请自行搜索),故不开启。
58+
### SSH
59+
为了修改一些笔记本特定底层设置,故开启,顺带修改了一下访问端口。
60+
### 安全性
61+
- 端口设置中强制开启 HTTPS 访问
62+
- 账号安全内启用强制双重验证
63+
- 启用防火墙(如果修改了 SSH 端口记得放行)
64+
### 文件共享协议
65+
默认开启。
66+
#### 其他 Linux 设备挂载 SMB 文件夹的解决方案
67+
安装组件
68+
```shell
69+
sudo apt update
70+
sudo apt install cifs-utils
71+
```
72+
创建凭据文件(安全起见不将 SMB 账号密码明文写在 `/etc/fstab` 中)
73+
```shell
74+
vim ~/.smbcredentials
75+
```
76+
在文件中写入 fnOS 的账号密码信息
77+
```
78+
username=<your smb username>
79+
password=<your smb password>
80+
```
81+
保存退出后修改文件权限
82+
```shell
83+
chmod 600 ~/.smbcredentials
84+
```
85+
创建挂载点
86+
```shell
87+
sudo mkdir -p /mnt/Contents
88+
```
89+
修改 `\etc\fstab`
90+
```shell
91+
sudo vim /etc/fstab
92+
```
93+
在其中添加 SMB 挂载参数
94+
```
95+
//<device IP>/<shared folder name> /mnt/Contents cifs credentials=/home/<your Ubuntu username>/.smbcredentials,uid=1000,gid=1000,iocharset=utf8,_netdev,x-systemd.automount,x-systemd.requires=network-online.target 0 0
96+
```
97+
部分参数解释:
98+
- `_netdev`:告诉系统这是一个网络设备,等待网络就绪后再处理。
99+
- **`x-systemd.automount`****(断线重连的核心)** 启用按需挂载。如果 SMB 设备掉线,一旦设备恢复,再次访问该目录就会自动重新挂载。
100+
- `x-systemd.requires=network-online.target`:确保网络完全在线后再进行挂载尝试。
101+
102+
重新加载并测试
103+
```shell
104+
sudo systemctl daemon-reload
105+
sudo systemctl restart remote-fs.target
106+
ls /mnt/Contents
107+
```
108+
#### Time Machine
109+
手里有 mac 设备,所以开启了。
110+
尽量使用 SSD 用于 Time Machine 备份,不要使用 HDD,不然查找历史文件的速度可能会慢到你怀疑人生(尤其是叠瓦盘)。
111+
### 通知设置
112+
配置了 QQ 邮箱的发送服务。
113+
### 硬件和电源
114+
启用 UPS 支持,可以使用笔记本内置电源作为 UPS。
115+
## 辅助系统设置
116+
因机而异。
117+
### 限制 CPU 频率
118+
由于这台笔记本 CPU 频率超过 3.9 GHz 就必定死机,所以需要手动限制一下最高频率。
119+
笔者使用 [`auto-cpufreq`]([https://github.com/AdnanHodzic/auto-cpufreq](https://github.com/AdnanHodzic/auto-cpufreq)) 作为工具
120+
121+
安装 `auto-cpufreq`
122+
```bash
123+
git clone <https://github.com/AdnanHodzic/auto-cpufreq.git>
124+
cd auto-cpufreq && sudo ./auto-cpufreq-installer
125+
```
126+
127+
修改配置文件
128+
```bash
129+
sudo vim /etc/auto-cpufreq.conf
130+
```
131+
132+
添加如下内容
133+
```
134+
# settings for when connected to a power source
135+
[charger]
136+
governor = performance
137+
energy_performance_preference = performance
138+
scaling_max_freq = 3900000
139+
turbo = auto
140+
141+
# settings for when using battery power
142+
[battery]
143+
governor = powersave
144+
energy_performance_preference = power
145+
scaling_max_freq = 3900000
146+
turbo = auto
147+
```
148+
149+
你可以参考官方提供的[示例文件]([AdnanHodzic/auto-cpufreq: Automatic CPU speed & power optimizer for Linux](https://github.com/AdnanHodzic/auto-cpufreq?tab=readme-ov-file#example-config-file-contents))按需修改你的配置文件。
150+
151+
安装守护进程以持久化修改
152+
```bash
153+
sudo auto-cpufreq --install
154+
```
155+
156+
使用 `auto-cpufreq --monitor`来监控 CPU 状态。
157+
158+
### 配置合盖不关机
159+
160+
```bash
161+
sudo vim /etc/systemd/logind.conf
162+
# find a line
163+
#HandleLidSwitch=suspend
164+
# change it to
165+
HandleLidSwitch=ignore
166+
# restart service
167+
sudo systemctl restart systemd-logind
168+
```
169+
## fnOS 应用推荐
170+
### 官方 App
171+
官方 App 有需要直接安装即可,影视、相册等做得还是非常不错的。
172+
顺带期待一手官方的音乐 App。
173+
### 第三方 App
174+
考虑到可迁移性的问题,所有第三方 App 我都会选择用 Docker 自行部署。
175+
### Docker
176+
支持 Docker Compose 且自带镜像仓库,好评。
177+
由于需要用到的 Docker 服务已经在[闲置笔记本折腾记录之 Ubuntu Server | Square Zhong's Blog](https://squarezhong.github.io/posts/2026-01-16-laptop-server/)中配置好了,故此处不再额外配置,仅对 qBittorrent 所挂载的下载盘进行修改。

0 commit comments

Comments
 (0)