首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >swapon: /swapfile:读取交换头失败:无效参数

swapon: /swapfile:读取交换头失败:无效参数
EN

Unix & Linux用户
提问于 2014-12-06 07:16:37
回答 1查看 41.7K关注 0票数 18
代码语言:javascript
运行
复制
#sudo dd if=/dev/zero of=/swapspacefile bs=1M count=2048k

  0+0 records in
  0+0 records out
  0 bytes (0 B) copied, 0.000417928 s, 0.0 kB/s

#chmod 600 /swapspacefile

   mkswap: error: swap area needs to be at least 40 KiB

   Usage:
     mkswap [options] device [size]

   Options:
     -c, --check               check bad blocks before creating the swap area
     -f, --force               allow swap size area be larger than device
     -p, --pagesize SIZE       specify page size in bytes
     -L, --label LABEL         specify label
     -v, --swapversion NUM     specify swap-space version number
     -U, --uuid UUID           specify the uuid to use
     -V, --version             output version information and exit
     -h, --help                display this help and exit


#sudo mkswap /swapspacefile

但当我把它扔到下面,

代码语言:javascript
运行
复制
  swapon: /swapfile: insecure permissions 0644, 0600 suggested.
  swapon: /swapfile: read swap header failed: Invalid argument
EN

回答 1

Unix & Linux用户

发布于 2018-10-24 11:43:42

我从评论中读到了这一点,但我认为我会作为一个答案而为人所见。

代码语言:javascript
运行
复制
# mkswap /swapfile

您应该运行此命令来准备用作交换空间的文件。

票数 37
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/171777

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档