1. dd instruction
Use dd this command to add a 128MB file under /tmp:
[root@www ~]# dd if=/dev/zero of=/tmp/swap bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 1.7066 seconds, 78.6 MB/s
View
[root@www ~]# ls -l /tmp/swap
-rw-r--r-- 1 root root 128M Oct 28 15:33 /tmp/swap
This 128MB file is built.
2. mkswap directive
Use mkswap to format the /tmp/swap file into a swap file format:
[root@www ~]# mkswap /tmp/swap
Setting up swapspace version 1, size = 134213 kB
# Please be careful when this command is issued, because the wrong character Control, it will probably hang your file system!
3. swapon instructions
Use swapon to start /tmp/swap.
View existing swap size
[root@www ~]# free
total used free shared buffers cached
Mem: 742664 450860 291804 0 45584 261284
-/+ buffers/cache: 143992 598672
Swap: 1277088 96 1276992
[root@www ~]# swapon /tmp/Swap
View the current swap size
[root@www ~]# free
total used free shared buffers cached
Mem: 742664 450860 291804 0 45604 261284
-/+ buffers/cache: 143972 598692
Swap: 1408152 96 1408056
[root@www ~]# swapon -s< Br>
Filename Type Size Used Priority
/dev/hdc5 partition 1020088 96 -1
/tmp/swap file 131064 0 -3
< H2>4. swapoff instruction
Use swapoff to turn off swap file
[root@www ~]# swapoff /tmp/swap
[root @www ~]# free
total used free shared buffers cached
Mem: 742664 450860 291804 0 45660 261284
-/+ buffers/cache: 143916 598748
Swap: 1020088 96 1019992 <==Revert to the original look!
We need to mount swap in /etc/fstab.
Use the command: sudo gedit /etc/fatab to open the fatab file and add it:
# <file system> <mount point> <type> <options> < ;dump> <pass>
proc /proc proc defaults 0 0
/tmp/swap none swap defaults 0 0
source /etc/fstab will take effect immediately, and it will be guaranteed to take effect the next time you reboot. It's that simple.
Download NetBeans Take netbeans-7.0beta2-ml-javaee-linux.sh as an example #sh netbeans-7.0beta2-ml-
1 Start vSphere Client2 Start Virtual Machine [Right-click on VM, select Power —>Open] and
Redis is an open source, log-based, Key-Value database that is written in ANSI C, supports networki
The configuration steps of Telnet service are as follows: First, install telnet package (usually tw
Linux uses Wireshark for packet capture analysis (including SIP and RTP packets)
Explanation: When a segmentation error occurs, how does the Linux system generate the core file
Linux obtains the native ip address method through Shell.
Mandriva Linux Financial Crisis New investors reach out
Linux sql*plus history command callback problem
Enhanced Security Devil Linux 1.6.1 Release
Rookie class: teach you how to improve the security of Linux system
Storm Jane Assistant how to uninstall
How to modify the default open mode of file suffix in win7 system
What should I do if the speed of the WIN7 switch is slow?
Win7 system prohibits writing to folders
What to do when Windows 7 crashes at boot time
Windows7 system timed shutdown: 1, set the system to shut down regularly
Setting up Security Server for Win Server 2003
Win7 system E disk denied access how to solve
The dangerous operation of Windows that damages the hard disk