每个指南都提出永久禁用交换,只需注释掉相应的行/etc/fstab即可防止交换在重新启动时安装;然而,这在 Debian 11 中不起作用。
例子:
\nsudo swapoff -a工作完美,但在重新启动后不会持续存在。
fstab 文件示例,其中行被注释掉:
\n# /etc/fstab: static file system information.\n#\n# Use 'blkid' to print the universally unique identifier for a\n# device; this may be used with UUID= as a more robust way to name devices\n# that works even if disks are added and removed. See fstab(5).\n#\n# systemd generates mount units based on this file, see systemd.mount(5).\n# Please run 'systemctl daemon-reload' after making changes here.\n#\n# <file system> <mount …Run Code Online (Sandbox Code Playgroud)