mkdir swap  //创件文件夹

cd swap

sudo dd if=/dev/zero of=swapfile bs=1024 count=12000000  //其中bs是创建 1024是kb   后面1000个就是1MB   1000000就是1000MB=1G
记录了 100000+0 的读入
记录了 100000+0 的写出
102400000 字节 (102 MB) 已复制,0.74704 秒,137 MB/秒

//把生成的文件转换成 Swap 文件
sudo mkswap swapfile

sudo swapon swapfile

swapfilepath swap swap defaults 0 0
vim /etc/fstab   //编辑文件

/root/swap/swapfile swap swap defaults 0 0
文章: 96

75 评论

  1. This article offers a fascinating perspective on the subject. The depth of research and clarity in presentation make it a valuable read for anyone interested in this topic. It’s refreshing to see such well-articulated insights that not only inform but also provoke thoughtful discussion. I particularly appreciated the way the author connected various aspects to provide a comprehensive understanding. It’s clear that a lot of effort went into compiling this piece, and it certainly pays off. Looking forward to reading more from this author and hearing other readers’ thoughts. Keep up the excellent work!

  2. Great article! I appreciate the clear and insightful perspective you’ve shared. It’s fascinating to see how this topic is developing. For those interested in diving deeper, I found an excellent resource that expands on these ideas: check it out here. Looking forward to hearing others’ thoughts and continuing the discussion!


您的电子邮箱地址不会被公开。 必填项已用 * 标注