If you are currently using Ubuntu system, whether it is a virtual machine or a physical machine, there is no or insufficient swap swap Swap partition space, you can set Swap swap space.
Provided herein is a simple way to set the swap space.
Why set up swap space after the operating system is installed?
1, and article "Windows 8.1 installed Ubuntu 14.04 dual system reference tutorials and dual hard drives Considerations" in this article are directly related http://www.linuxidc.com/Linux/2015-08/122140.htm. In this tutorial reference, I did not set up a swap partition when installing Ubuntu.
2, the swap partition is not necessary, but some software is mandatory for the system containing the swap partition. So after not set the swap partition Ubuntu system installation is successful, it needs to be allocated swap partition is entirely for its existence.
Ready to work
The core of this method is to create a swap file partition, and then let the system mount the swap file.
Step 1 Check swap
In the end run "free -m" command to view the current system swap space information:
Swap total value is 0, indicating that the current system is not set up swap space. Mem refers to a computer memory size, as shown in Fig. 2G.
Step 2 Create and Mount
Because of the following series of commands to be executed with root privileges, so let's get administrator privileges. Execute "sudo -i" command in a terminal, enter the user password obtained.
1. Create a swap directory in the root directory (folder): "mkdir / swap"
2, into the swap space has been created directory: "cd / swap"
3, specify a size of 1G called "swap" swap file (you can customize the file name): "dd if = dev / zero of = swap bs = 1M count = 1k". Bs * count by the size of the space is calculated.
4, create a swap file: "mkswap swap"
5, mounting swap partition: "swapon swap"
6, view swap information: "free -m"
7, uninstall command swap partition: "swapoff swap"
8, you can see called "swap" swap file we created in the specified directory.
Thus, the swap partition created.