Web Design

Categorized | System, cli

Add extra SWAP in Linux

If, by any chance, you happen to run out of SWAP space in Linux and you desperately need it, you can use a temporary file to supplement:

dd if=/dev/zero of=/swap1.swp bs=1024 count=512K

mkswap /swaptemp.swp

swapon /swaptemp.swp

Now verify if the image file was successfully mounted:

cat /proc/swaps

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


2 Comments

  1. Oleg

    For novice not evident, that ‘bs=1024′ and ‘count=512K’ are not mandatory and what whis do swap file 500M.
    I’m think, article need be more verbose.
    Again, ‘bs’ = ‘block size’ and ‘count’ = ‘count’. His values must be exchanged, so:

    [code]dd if=/dev/zero of=/swapfile bs= count=[/code]

    P.S. Do your site have BBCode’s? :)
    P.P.S. Advise make up notations of convention.

    1
  2. Oleg

    Hm… Site cute the < / >
    [code]dd if=/dev/zero of=/swapfile bs=<block_size> count=<blocks_count>[/code]

    2

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>