旧方法: truncate -s 0 swapfile chattr +C swapfile fallocate -1 2G swapfile chmod 0600 swapfile mkswap swapfile swapon swapfile #启用SWAP 新方法: btrfs filesystem mkswapfile --size 2G swapfile swapon swapfile #启用SWAP
参考文档:https://btrfs.readthedocs.io/en/latest/Swapfile.html
PS:
在给飞牛OS的btrfs数据卷里创建swapfile死活启用不了,extent文件不连续(btrfs要求swap的extent只有1)。 最后发现新方法果然好使了。
新方法方便了很多
btrfs yes
帮我节省了大量的重装系统时间
Featured Collection
Popular Events
参考文档:https://btrfs.readthedocs.io/en/latest/Swapfile.html
PS:
在给飞牛OS的btrfs数据卷里创建swapfile死活启用不了,extent文件不连续(btrfs要求swap的extent只有1)。
最后发现新方法果然好使了。