首页 > 系统相关 >ubuntu failed to activate swap/swapfile

ubuntu failed to activate swap/swapfile

时间:2023-06-13 10:45:41浏览次数:41  
标签:activate swapfile sudo failed command swap file ubuntu

Copy from 

https://www.makeuseof.com/fix-read-error-on-swap-device-ubuntu/

 

sudo swapoff /swapfile

Once the swap file has been disabled, you are ready to create a new swap file. For example, to create a swap file of 4G, run the following command.

sudo fallocate -l 4G /swapfile

For security purposes, you should assign your swap file with only read-write permissions on the root user, using the command below.

sudo chmod 600 /swapfile

You can specify that the /swapfile is a swap area using the mkswap utility as below.

sudo mkswap /swapfile

Finally, you can enable or start your swap file by running the following command.

sudo swapon /swapfile

标签:activate,swapfile,sudo,failed,command,swap,file,ubuntu
From: https://www.cnblogs.com/Fred1987/p/17476849.html

相关文章