<?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>El blog de LandM &#187; System</title>
	<atom:link href="http://blog.landm.net/category/system/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.landm.net</link>
	<description>System Administrators and IT experts Blog</description>
	<lastBuildDate>Thu, 17 Jun 2010 08:34:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a swap file under Linux</title>
		<link>http://blog.landm.net/2008/12/creating-a-swap-file-under-linux/</link>
		<comments>http://blog.landm.net/2008/12/creating-a-swap-file-under-linux/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 16:49:32 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[swapfile]]></category>

		<guid isPermaLink="false">http://blog.landm.net/?p=132</guid>
		<description><![CDATA[Last week Lucas my co-worker Lucas noticed that in one of our servers didn’t have a swap partition, until now things were going ok because server didn’t have much RAM usage, but now servers is getting more traffic each day and sometimes free ram gets extremely low.
In a normal situation the process here should be, [...]]]></description>
			<content:encoded><![CDATA[<p>Last week Lucas my co-worker Lucas noticed that in one of our servers didn’t have a swap partition, until now things were going ok because server didn’t have much RAM usage, but now servers is getting more traffic each day and sometimes free ram gets extremely low.</p>
<p>In a normal situation the process here should be, reboot the server, and using gparted or similar create a small amount of free space and allocate that as a swap partition. Fortunately this not needed nowadays, since Kernel 2.6 swap file performance has increased dramatically so the possible benefits from having a dedicated swap partition against  a swap file are so small that in some situations it is preferable to have a swap file in case you wan’t to increase / decrease it’s size.</p>
<p>The process for building this kind of swap files is very simple:</p>
<p><em># dd if=/dev/zero of=/home/swap bs=1M count=1024</em></p>
<p>Replacing 1024 with the number of megabytes you want will change the swap file size.</p>
<p>Now that we have the size we want on disk we can prepare it for usage as a swap partition:</p>
<p><em># mkswap /home/swap</em></p>
<p>Now the swap file has being built you must introduce the following line in /etc/fstab file so this partition get’s mounted once the system is rebooted:</p>
<p><em>/home/swap       swap            swap    defaults 0       0</em></p>
<p>And finally to test the swap file you should type, which would activate all the partitions marked as “swap” in /etc/fstab</p>
<p><em># swapon –a</em></p>
<p>Now finally we can check that the swap partition has being activated:<br />
<em><br />
# free -m<br />
total       used       free     shared    buffers     cached<br />
Mem:          2028       1719        308          0        132       1119<br />
-/+ buffers/cache:        468       1559<br />
Swap:         1023          0       1023<br />
</em></p>
<p>Finally there are two useful commands you should be aware if you are playing around with swap files:</p>
<p><em># swapon | swapoff <swapfile></em></p>
<p>This commands activate and deactivate the usage of swap file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.landm.net/2008/12/creating-a-swap-file-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
