Swap: Difference between revisions

No edit summary
add note about when to use dd
Line 11: Line 11:
# dd if=/dev/zero of=/swapfile bs=1G count=2
# dd if=/dev/zero of=/swapfile bs=1G count=2
# fallocate is faster than dd because it doesn't actually write 2GB of zeroes
# fallocate is faster than dd because it doesn't actually write 2GB of zeroes
# however, if you get an error (e.g. CentOS) when you get to 'swapon', then you'll need to physically create a file using dd
fallocate -l 2G /swapfile
fallocate -l 2G /swapfile
# set permissions so that nobody but root can read/write
# set permissions so that nobody but root can read/write
Line 38: Line 39:
</source>
</source>


[[Category:System Administration]] [[Category:Cloud]]
[[Category:System Administration]]
[[Category:Cloud]]