BTRFS 警告(裝置 xxx):交換檔案不得為寫入時複製。為什麼禁用時交換會被啟動?

BTRFS 警告(裝置 xxx):交換檔案不得為寫入時複製。為什麼禁用時交換會被啟動?

我有SSD。當我檢查時,dmesg我看到警告並失敗:

$ sudo dmesg | grep swap
[    0.085887] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.429424] zswap: loaded using pool lzo/zbud
[   35.685791] systemd[1]: Activating swap /swapfile...
[   35.690098] BTRFS warning (device nvme0n1p4): swapfile must not be copy-on-write
[   35.691545] systemd[1]: swapfile.swap: Swap process exited, code=exited, status=255/EXCEPTION
[   35.691549] systemd[1]: swapfile.swap: Failed with result 'exit-code'.
[   35.691934] systemd[1]: Failed to activate swap /swapfile.
[   35.691969] systemd[1]: swap.target: Job swap.target/start failed with result 'dependency'.
[   36.112620] BTRFS warning (device nvme0n1p4): swapfile must not be copy-on-write
[   36.326045] BTRFS warning (device nvme0n1p4): swapfile must not be copy-on-write

如果我停用交換區,為什麼系統會嘗試啟動交換區?

$ cat /etc/fstab | grep swap
/swapfile                                 none            swap    sw              0       0

答案1

要真正停用交換文件,我們應該這樣做:

在 shell 提示字元下以 root 身分執行下列命令以停用交換檔案(其中 /swapfile 是交換檔案):
swapoff -v /swapfile
從 /etc/fstab 檔案中刪除其條目。
刪除實際檔案:
rm /swapfile

https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-removing-file.html

相關內容