linux swap file

1. generate null file with size = 1 G 

dd if=/dev/zero of=/mnt/test/swap1 bs=1024 count=1048576

2.  create swap file
 mkswap /mnt/test/swap1

3.  enable swap file work
 swapon /mnt/test/swap1

你可能感兴趣的:(linux swap file)