Difference between revisions of "Swap linux"

From Teknologisk videncenter
Jump to: navigation, search
(Created page with "Using file as temporary swap <source> free ... dd if=/dev/zero of=/swapfile bs=1M count=1000 # Create swapfile on 1GB chmod 0600 /swapfile # Make it secure mkswap /swapfi...")
 
m
 
Line 1: Line 1:
 
Using file as temporary swap
 
Using file as temporary swap
 
<source>
 
<source>
free
+
# 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
  
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
 
free
 
....
 
 
</source>
 
</source>
 
[[category:Linux]]
 
[[category:Linux]]

Latest revision as of 13:59, 4 April 2024

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