Swap linux

From Teknologisk videncenter
Jump to: navigation, search

Using file as temporary swap

# free
               total        used        free      shared  buff/cache   available
Mem:          657328      363784      261016        5864      135080      293544
Swap:              0           0           0


# dd if=/dev/zero of=/swapfile bs=1M count=1000    # Create swapfile on 1GB 
# chmod 0600 /swapfile # Make it secure
# mkswap /swapfile   # Prepare swapfiile for use
# swapon /swapfile   # Start usiong it
# ? # Use som memory :-)
#free
               total        used        free      shared  buff/cache   available
Mem:          657328      613148       40728        5680      105672       44180
Swap:        1023996      124380      899616