<?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>linux swap command &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/linux-swap-command/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Sat, 14 May 2011 11:23:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>How To Add/Create Swap File</title>
		<link>https://lifelinux.com/how-to-add-create-swap-file/</link>
					<comments>https://lifelinux.com/how-to-add-create-swap-file/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sat, 14 May 2011 10:56:19 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[create linux swap file]]></category>
		<category><![CDATA[dd command]]></category>
		<category><![CDATA[free command]]></category>
		<category><![CDATA[linux swap command]]></category>
		<category><![CDATA[linux swap commands]]></category>
		<category><![CDATA[linux swap file]]></category>
		<category><![CDATA[linux swap file partition]]></category>
		<category><![CDATA[linux swap file size]]></category>
		<category><![CDATA[linux swap file system]]></category>
		<category><![CDATA[linux swap filesystem]]></category>
		<category><![CDATA[linux swap partitions]]></category>
		<category><![CDATA[linux swap space]]></category>
		<category><![CDATA[linux swapfile]]></category>
		<category><![CDATA[mkswap command]]></category>
		<category><![CDATA[redhat swap file]]></category>
		<category><![CDATA[swapfile in linux]]></category>
		<category><![CDATA[swapon command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=498</guid>

					<description><![CDATA[<p>If you need additional swap space to improve your system performance. You have two different ways: add/upgrade a swap partition or create a swap file. But changing the size or create a new swap partition is not easy, the best solution is to create a new swap file. This articles help you add/create swap file [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-add-create-swap-file/">How To Add/Create Swap File</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>If you need additional swap space to improve your system performance. You have two different ways: add/upgrade a swap partition or create a swap file. But changing the size or create a new swap partition is not easy, the best solution is to create a new swap file. This articles help you add/create swap file very quickly.<span id="more-498"></span></p>
<h3>Creating swap file on Linux</h3>
<p>Login as root and type the following command to create 512MB swap file</p>
<pre>
[root@lifelinux ~]# dd if=/dev/zero of=/swapfile bs=1024 count=524288
</pre>
<p>Where,<br />
<strong>if=/dev/zero</strong>: read from /dev/zero instead of stdin<br />
<strong>of=/swapfile</strong>: write to /swapfile instead of stdout<br />
<strong>bs=1024</strong>: blocksize = 1024 bytes<br />
<strong>count=524288</strong>: number of blocks are 524288</p>
<p>Setup the swap file with the command: mkswap. Type following command to setup your swap file:</p>
<pre>
[root@lifelinux ~]# mkswap /swapfile
</pre>
<p>To enable the swap file immediately but not automatically at boot time</p>
<pre>
[root@lifelinux ~]# swapon /swapfile
</pre>
<p>To activate the new swap file automatically at the boot, you need to edit the file /etc/fstab, enter</p>
<pre>
[root@lifelinux ~]# vi /etc/fstab
</pre>
<p>Add the following line at end of the file</p>
<pre>
/swapfile         swap             swap        defaults         0   0
</pre>
<p>To verify the swap file is working fine with these commands: </p>
<pre>
[root@lifelinux ~]# free -m
</pre>
<p>Or </p>
<pre>
[root@lifelinux ~]# cat /proc/swaps
</pre>
<h3>Recommended size of linux swap</h3>
<p>1 GB RAM &#8212;> 2 GB of Swap file<br />
2 GB RAM &#8212;> 4 GB of Swap file<br />
4 GB RAM &#8212;> 8 GB of Swap file<br />
8 GB RAM &#8212;> 12 GB of Swap file<br />
16 GB RAM &#8212;> 24 GB of Swap file<br />
32 GB RAM &#8212;> 32 GB of Swap file</p>
<g:plusone href="https://lifelinux.com/how-to-add-create-swap-file/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-add-create-swap-file/">How To Add/Create Swap File</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-add-create-swap-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
