https://aws.amazon.com/amazon-linux-ami/2015.09-release-notes/ su - //su -s
利用dd命令创建存储文件,这里我们创建一个512M的文件足矣
1 2 3 4 5 6 7 8 9 10
# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 524288+0 records in 524288+0 records out 536870912 bytes (537 MB) copied, 3.23347 s, 166 MB/s
> if=/dev/zero : Read from /dev/zero file. /dev/zero is a special file in that provides as many null characters to build storage file called /swapfile1. > of=/swapfile1 : Read from /dev/zero write storage file to /swapfile1. > bs=1024 : Read and write 1024 BYTES bytes at a time. > count=524288 : Copy only 523288 BLOCKS input blocks.