Create SWAP at Linux

SWAP_SIZE=1000 # 1000M
# Create file
dd if=/dev/zero of=$SWAP_FILE bs=$BLOCK_SIZE count=$SWAP_BLOCKS
# Make swap
mkswap $SWAP_FILE
# Security
chown root:root $SWAP_FILE
chmod 0600 $SWAP_FILE
# Swap enable
swapon $SWAP_FILE
# Add to fstab to auto start
echo "$SWAP_FILE swap swap defaults 0 0" >> /etc/fstab
# Check if you have new 
free -m
howto/create_swap_at_linux.txt · Last modified: 2022/01/03 16:03 by
Back to top
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0