1. solve the problem by partitioning. 2. solve the problem by using the file method. if the hard disk partition is insufficient, you can consider using the file method. the specific method is to create a file with a certain capacity, then run the mkswap and swapon commands to mount the file and add it to the swap. the specific operations are as follows: cd/ddif /...
1. solve the problem by partitioning
2. solutions using files
If the hard disk partition is insufficient, you can use the file method. the specific method is
Create a file of a certain capacity, and then use the mkswap and swapon commands to mount the file and add
Swap:
Cd/
Dd if =/dev/zero of =/swapfile bs = 1 M count = 1024 # Create a 1g File
Mkswap swapfile # set the file type to swap
Swapon swapfile # use swap for mounting. it is only attached to the memory. if you want to start the system, modify/etc/fstab.
Free # view the swap space changes. The swap increases by 1 GB.
Swapon-s # View which partitions and files are used by swap, and the priority can be viewed. a larger number indicates the priority.
Higher
Modify the/etc/fstab file and insert the following content:
/Swapfile swap defaults 0 0
Restart the system and use free to view the verification.
This article is from the freedom Blog