This is an old revision of the document!
Create SWAP at Linux
SWAP_FILE=/swapfile BLOCK_SIZE=1024 SWAP_SIZE=1000 # 1000M SWAP_BLOCKS=$BLOCK_SIZE*$SWAP_SIZE # Create file dd if=/dev/zero of=$SWAP_FILE bs=$BLOCK_SIZE count=$SWAP_BLOCKS mkswap $SWAP_FILE chown root:root $SWAP_FILE chmod 0600 $SWAP_FILE swapon $SWAP_FILE echo "$SWAP_FILE swap swap defaults 0 0" >> /etc/fstab free -m