Create a swap file mkdir/var/swap # if the sub-swap partition of the installer is not too large. create a folder to store swap partition files, decide on your own chmod700/var/swap # Modify the switch partition folder permission to introduce some usage tips of the dd command hard disk copy: ddif =/dev/sdaof =/dev/sdb # copy a file of the specified size from sda to sdb: ddif =/dev/zeroof =/var/swap/fil
If the sub-swap partition of the installation host is not too large
Create a swap file
Mkdir/var/swap # Create a folder to store swap partition files, and decide chmod700/var/swap # modify swap partition folder permissions
Describes how to use the dd command.
Dd command Hard Disk Copy: ddif =/dev/sdaof =/dev/sdb # Copy sda and sdb to create a specified size file: ddif =/dev/zeroof =/var/swap/file. swapbs = 1024 k count = 64 # bs indicates that the data file size 1024k is 1 MB, so it is set to 1024 k. However, unix does not support this syntax or requires byte Computing # count is the number of databases 64 64 M
Here we need dd to create a file using swap
Ddif =/dev/zeroof =/var/swap/file. swap bs = 1024 k count = 64 # Create a 64 M file
Next we need mkswap
Mkswap/var/swap/file. swap # Create a swap file vim/etc/fstab # write the Mount table/var/swap/file. swap defauls 0 # enable this swap partition swapon/var/swap/file at startup. swap # enable swapoff/var/swap/file. swap # Disable df-h to observe the changes
This article is from the blog "someone says my technology House", please be sure to keep this source http://1992mrwang.blog.51cto.com/3265935/1270592