<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sebastian Mogilowskis Blog &#187; Swap</title>
	<atom:link href="http://www.mogilowski.net/lang/en-us/tag/swap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mogilowski.net</link>
	<description>Just another blog about administration, linux and other stuff</description>
	<lastBuildDate>Fri, 30 Jul 2010 06:26:33 +0000</lastBuildDate>
	<language>en-us</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Add swap file to a linux server (Debian or Ubuntu)</title>
		<link>http://www.mogilowski.net/lang/en-us/2009/08/20/add-swap-file-to-a-linux-server-debian-or-ubuntu</link>
		<comments>http://www.mogilowski.net/lang/en-us/2009/08/20/add-swap-file-to-a-linux-server-debian-or-ubuntu#comments</comments>
		<pubDate>Thu, 20 Aug 2009 07:57:41 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systemadministration]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Swap]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=522</guid>
		<description><![CDATA[This article describes how you can add a swap file on Debian or Ubuntu. You can use this to add additional swap space or to add swap to a server without any swap space. (You can use this as temporary swap space, too) 1. Create the swap file: Use &#8220;dd&#8221; to create the swap file. [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en-us">This article describes how you can add a swap file on Debian or Ubuntu. You can use this to add additional swap space or to add swap to a server without any swap space. (You can use this as temporary swap space, too)</span></p>
<h3><span lang="en-us">1. Create the swap file:</span></h3>
<p><span lang="en-us">Use &#8220;<em>dd</em>&#8221; to create the swap file. The following command creates a 1024MB swap file (1024 * 1024MB = 1048576).</span></p>
<pre>
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
</pre>
<pre>
root@server:~# dd if=/dev/zero of=/swapfile bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 16.8866 s, 63.6 MB/s
</pre>
<h3><span lang="en-us">2. Set up a Linux swap area:</span></h3>
<pre>
mkswap /swapfile
</pre>
<pre>
root@server:~# mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=9748279e-3efa-4e33-a305-3c14527cfb30
</pre>
<h3><span lang="en-us">3. Activate swap space:</span></h3>
<pre>
swapon /swapfile
</pre>
<h3><span lang="en-us">4. Add swap file to fstab (optional)</span></h3>
<p><span lang="en-us">To activate the swap file on system start, add entry the following line to &#8220;<em>/etc/fstab</em>&#8220;.</span></p>
<pre>
/swapfile swap swap defaults 0 0
</pre>
<h3><span lang="en-us">5. Check swap</span></h3>
<p><span lang="en-us">Execute &#8220;<em>free -m</em>&#8221; or use &#8220;<em>top</em>&#8221; to check the swap space of your system:</span></p>
<pre>
root@server:~# free -m
             total       used       free     shared    buffers     cached
Mem:          3529       3427        102          0         21       3198
-/+ buffers/cache:        208       3321
Swap:         1535          0       1535
</pre>
<p><span lang="en-us">Here you see the server with the 1024MB Swap file and a prior existing 512MB swap partition.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2009/08/20/add-swap-file-to-a-linux-server-debian-or-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
