<?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>Tairan&#039;s Story &#187; swap</title>
	<atom:link href="http://www.tairan.net/index.php/tag/swap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tairan.net</link>
	<description>「知之真切笃实处即是行，行之明觉精察处即是知，知行工夫不可离。」</description>
	<lastBuildDate>Fri, 02 Dec 2011 08:08:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>在linux上使用swap文件</title>
		<link>http://www.tairan.net/index.php/2009/11/22/using-the-swap-file/</link>
		<comments>http://www.tairan.net/index.php/2009/11/22/using-the-swap-file/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 03:26:26 +0000</pubDate>
		<dc:creator>Daniel Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[我的声音]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[swap]]></category>

		<guid isPermaLink="false">http://www.tairan.net/?p=684</guid>
		<description><![CDATA[作为个人用户，为swap分一个磁盘分区有些浪费，其实我们可以使用swap file来替代swap 分区，而且还可以很方便的调整swap file文件的大小。 To add a swap file: 1. Determine the size of the new swap file and multiple by 1024 to determine the block size. For example, the block size of a 64 MB swap file is 65536. 2. At a shell prompt as root, type the following command with count being equal [...]]]></description>
			<content:encoded><![CDATA[<p>作为个人用户，为swap分一个磁盘分区有些浪费，其实我们可以使用swap file来替代swap 分区，而且还可以很方便的调整swap file文件的大小。</p>
<blockquote><p> <strong>To add a swap file:</strong></p>
<p>   1.  Determine the size of the new swap file and multiple by 1024 to determine the block size. For example, the block size of a 64 MB swap file is 65536.</p>
<p>   2.  At a shell prompt as root, type the following command with count being equal to the desired block size:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">      <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>swapfile <span style="color: #007800;">bs</span>=<span style="color: #000000;">1024</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">65536</span></pre></div></div>

<p>   3.  Setup the swap file with the command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">      mkswap <span style="color: #000000; font-weight: bold;">/</span>swapfile</pre></div></div>

<p>   4. To enable the swap file immediately but not automatically at boot time:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">      swapon <span style="color: #000000; font-weight: bold;">/</span>swapfile</pre></div></div>

<p>   5.  To enable it at boot time, edit <em>/etc/fstab</em> to include:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">      <span style="color: #000000; font-weight: bold;">/</span>swapfile               swap                    swap    defaults        <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></div></div>

<p>      The next time the system boots, it will enable the new swap file.</p>
<p>   6. After adding the new swap file and enabling it, make sure it is enabled by viewing the output of the command cat <em>/proc/swaps</em> or free.
</p></blockquote>
<p>参考:<br />
     <a href="http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/s1-swap-adding.html" target="_blank">RHL-8.0-Manual</a></p>
<p>EOF</p>
<hr />
<p><small>© Daniel Wang for <a href="http://www.tairan.net">Tairan&#039;s Story</a>, 2009. |
<a href="http://www.tairan.net/index.php/2009/11/22/using-the-swap-file/">Permalink</a> |
<a href="http://www.tairan.net/index.php/2009/11/22/using-the-swap-file/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.tairan.net/index.php/2009/11/22/using-the-swap-file/&title=在linux上使用swap文件">del.icio.us</a>
<br/>
Post tags: <a href="http://www.tairan.net/index.php/tag/linux/" rel="tag">linux</a>, <a href="http://www.tairan.net/index.php/tag/swap/" rel="tag">swap</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tairan.net/index.php/2009/11/22/using-the-swap-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

