How to manually create and delete SWAP files in LINUX: 1. determine the size of the swap file, in MB. Multiply the value by 1024 to obtain the block size. For example, the block size of a 64 MB swap file is 65536. 2. at the root prompt, type the following command, where the count size is equal to the required block size... how to manually create and delete SWAP files in LINUX: 1. determine the size of the swap file, in MB. Multiply the value by 1024 to obtain the block size. For example, the block size of a 64 MB swap file is 65536. 2. at the root prompt, type the following command, where count is equal to the required block size: dd if =/dev/zero f =/swapfile bs = 1024 count = 655363. create a swap file: mkswap/swapfile4. open the swap file immediately instead of automatically enabling it at startup: swapon/swapfile5. to enable it at startup, add the following content to/etc/fstab: /swapfile swap defaults 0 0 the next time the system starts, the new swap file is opened. 6. after adding a new swap file and enabling it, check the output of cat/proc/swaps or the free command to check whether swap is enabled. 7. delete SWAP partition swapoff/swapfile modify/etc/fstab file rm-rf/swapfile 1 block = 512 bytes
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.