本文由 AI 生成!!!
问题现象
在 CachyOS(Linux 7.0.9 + 新 ntfs 驱动)上,把 Steam 库放在 NTFS 分区,所有 Proton 游戏都无法启动。点击”开始游戏”后短暂闪现”正在运行”,几秒后回到”开始游戏”状态。
而在同一台机器上,用 Lutris + dwproton 启动的 Endfield 却完全正常。
错误日志
打开 ~/.local/share/Steam/logs/console-linux.txt,可以看到清晰的 traceback:
1
2
3
4
5
6
7
8
9
10
[2026-05-24 16:55:49] Proton: Upgrading prefix from 10.0-200 to GE-Proton10-34
[2026-05-24 16:55:49] Proton: Prefix has an invalid version?! You may want to back up user files and delete this prefix.
[2026-05-24 16:55:49] Traceback (most recent call last):
File "/usr/share/steam/compatibilitytools.d/proton-ge-custom/proton", line 2386, in <module>
g_session.init_session(sys.argv[1] != "runinprefix")
File "/usr/share/steam/compatibilitytools.d/proton-ge-custom/proton", line 2202, in init_session
g_compatdata.setup_prefix()
File "/usr/share/steam/compatibilitytools.d/proton-ge-custom/proton", line 1076, in setup_prefix
os.symlink("../drive_c", self.prefix_dir + "/dosdevices/c:")
OSError: [Errno 22] Invalid argument: '../drive_c' -> '/mnt/games/SteamLibrary/steamapps/compatdata/601150/pfx//dosdevices/c:'
关键就是 Errno 22 Invalid argument:Proton 尝试创建名为 c: 的 symlink 时失败了。
根本原因
查看驱动源码 fs/ntfs/namei.c 第 43-58 行:
1
2
3
4
5
6
7
8
9
10
11
12
13
static inline int ntfs_check_bad_char(const __le16 *wc, unsigned int wc_len)
{
int i;
for (i = 0; i < wc_len; i++) {
u16 c = le16_to_cpu(wc[i]);
if (c < 0x0020 ||
c == 0x0022 || c == 0x002A || c == 0x002F ||
c == 0x003A || c == 0x003C || c == 0x003E ||
c == 0x003F || c == 0x005C || c == 0x007C)
return -EINVAL;
}
return 0;
}
字符码对照:
| 码点 | 字符 |
|---|---|
| 0x0022 | " |
| 0x002A | * |
| 0x002F | / |
| 0x003A | : |
| 0x003C | < |
| 0x003E | > |
| 0x003F | ? |
| 0x005C | \ |
| 0x007C | \| |
而 ntfs_symlink()(第 1429 行)在创建 symlink 之前强制调用 ntfs_check_bad_windows_name(),后者一进门就无条件跑 ntfs_check_bad_char():
1
2
3
4
5
6
7
static int ntfs_check_bad_windows_name(...) {
if (ntfs_check_bad_char(wc, wc_len)) // 无条件
return -EINVAL;
if (!NVolCheckWindowsNames(vol)) // windows_names 检查在这之后才生效
return 0;
...
}
关键结论:windows_names 挂载选项只控制保留名(CON / PRN / AUX / COM1…)和尾部空格/点的检查,而 "*/:<>?\| 这 9 个字符是硬编码强制拒绝的,没有任何挂载选项可以关闭。
而 ntfs-3g 把这 9 个字符的检查也放在 windows_names 选项后面,默认不启用 → 所以早些年用 ntfs-3g 的玩家能正常跑 Proton。
解决方案:把 compatdata 软链到 btrfs
思路:让 Steam 以为 prefix 还在原位,但实际写到 btrfs 上。游戏本体(几十~上百 GB 的资源)仍然留在 NTFS,只把几 GB 的 prefix 移到 ext4。
1
2
3
4
5
6
7
8
9
# 1. 创建 home 上的存放目录
mkdir -p ~/SteamCompatData
# 2. 备份原 compatdata(里面的 prefix 都被损坏过,保险起见)
mv /mnt/games/SteamLibrary/steamapps/compatdata \
/mnt/games/SteamLibrary/steamapps/compatdata.bak
# 3. 建立 symlink
ln -s ~/SteamCompatData /mnt/games/SteamLibrary/steamapps/compatdata
如果有多个 SteamLibrary,每个库都要做一次同样的操作(指向不同的 home 子目录,例如 ~/SteamCompatData-lib2)。
- 游戏本体(几十~上百 GB)还在 NTFS,省 home 空间
- prefix(每个游戏 2~5 GB)在 ext4,Proton 工作正常
- Steam 完全无感知,云存档、成就、Overlay 都正常
- 一次设置,所有 Steam 游戏自动受益,不用每个游戏单独配启动选项