<?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>iTechLog &#187; MKSWAP</title>
	<atom:link href="http://itechlog.com/tag/mkswap/feed/" rel="self" type="application/rss+xml" />
	<link>http://itechlog.com</link>
	<description>Your source to IT solutions, interesting technology news and code snipets.</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:05:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>MKSWAP</title>
		<link>http://itechlog.com/linux-man-pages/2009/01/01/mkswap/</link>
		<comments>http://itechlog.com/linux-man-pages/2009/01/01/mkswap/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 19:11:00 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[Linux Man Pages]]></category>
		<category><![CDATA[MKSWAP]]></category>

		<guid isPermaLink="false">http://itechlog.com/linux-man-pages/2009/01/01/mkswap/</guid>
		<description><![CDATA[MKSWAP(8) Linux Programmer&#8217;s Manual MKSWAP(8) NAME mkswap &#8211; set up a Linux swap area SYNOPSIS mkswap [-c] [-vN] [-f] [-p PSZ] [-L label] [-U uuid] device [size] DESCRIPTION mkswap sets up a Linux swap area on a device or in a file. (After creating the swap area, you need the swapon command to start using [...]]]></description>
			<content:encoded><![CDATA[<p>MKSWAP(8)                  Linux Programmer&#8217;s Manual                 MKSWAP(8)</p>
<p>NAME<br />       mkswap &#8211; set up a Linux swap area</p>
<p>SYNOPSIS<br />       mkswap [-c] [-vN] [-f] [-p PSZ] [-L label] [-U uuid] device [size]</p>
<p>DESCRIPTION<br />       mkswap sets up a Linux swap area on a device or in a file.</p>
<p>       (After  creating  the  swap  area, you need the swapon command to start<br />       using it. Usually swap areas are listed in /etc/fstab so that they  can<br />       be  taken  into  use  at  boot time by a swapon -a command in some boot<br />       script.)</p>
<p>       The device argument will usually be a disk  partition  (something  like<br />       /dev/hda4  or /dev/sdb7) but can also be a file.  The Linux kernel does<br />       not look at partition Id&#8217;s, but many installation scripts  will  assume<br />       that partitions of hex type 82 (LINUX_SWAP) are meant to be swap parti-<br />       tions.  (Warning: Solaris also uses this type. Be careful not  to  kill<br />       your Solaris partitions.)</p>
<p>       The  size  parameter is superfluous but retained for backwards compati-<br />       bility.  (It specifies the desired size of the swap area  in  1024-byte<br />       blocks.  mkswap will use the entire partition or file if it is omitted.<br />       Specifying it is unwise &#8211; a typo may destroy your disk.)</p>
<p>       The PSZ parameter specifies the page size to use. It is  almost  always<br />       unnecessary  (even unwise) to specify it, but certain old libc versions<br />       lie about the page size, so it is possible that mkswap gets  it  wrong.<br />       The symptom is that a subsequent swapon fails because no swap signature<br />       is found. Typical values for PSZ are 4096 or 8192.</p>
<p>       Linux knows about two styles of swap areas, old style  and  new  style.<br />       The  last  10  bytes  of  the first page of the swap area distinguishes<br />       them: old style has `SWAP_SPACE&#8217;, new style has `SWAPSPACE2&#8242; as  signa-<br />       ture.</p>
<p>       In  the  old style, the rest of this first page was a bit map, with a 1<br />       bit for each usable page of the swap area.  Since the first page  holds<br />       this  bit  map,  the  first bit is 0.  Also, the last 10 bytes hold the<br />       signature. So, if the page size is  S,  an  old  style  swap  area  can<br />       describe  at  most 8*(S-10)-1 pages used for swapping.  With S=4096 (as<br />       on i386), the useful area is at most 133890048 bytes (almost 128  MiB),<br />       and the rest is wasted.  On an alpha and sparc64, with S=8192, the use-<br />       ful area is at most 535560992 bytes (almost 512 MiB).</p>
<p>       The old setup wastes most of this bitmap page, because zero bits denote<br />       bad blocks or blocks past the end of the swap space, and a simple inte-<br />       ger suffices to indicate the size of the  swap  space,  while  the  bad<br />       blocks,  if any, can simply be listed. Nobody wants to use a swap space<br />       with hundreds of bad blocks. (I would not even use a swap space with  1<br />       bad block.)  In the new style swap area this is precisely what is done.</p>
<p>       The maximum useful size of a swap area depends on the architecture  and<br />       the  kernel  version.  It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB<br />       on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on sparc64. For ker-<br />       nels after 2.3.3 there is no such limitation.</p>
<p>       Note  that  before 2.1.117 the kernel allocated one byte for each page,<br />       while it now allocates two bytes, so that taking a swap area of  2  GiB<br />       in use might require 2 MiB of kernel memory.</p>
<p>       Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10).<br />       The areas in use can be seen in the file /proc/swaps (since 2.1.25).</p>
<p>       mkswap refuses areas smaller than 10 pages.</p>
<p>       If you don&#8217;t know the page size that your machine uses, you may be able<br />       to  look  it up with &#8220;cat /proc/cpuinfo&#8221; (or you may not &#8211; the contents<br />       of this file depend on architecture and kernel version).</p>
<p>       To setup a swap file, it is necessary to create that file  before  ini-<br />       tializing it with mkswap , e.g. using a command like</p>
<p>              # dd if=/dev/zero of=swapfile bs=1024 count=65536</p>
<p>       Note  that  a  swap file must not contain any holes (so, using cp(1) to<br />       create the file is not acceptable).</p>
<p>OPTIONS<br />       -c     Check the device (if it is a block device) for bad blocks before<br />              creating the swap area.  If any are found, the count is printed.</p>
<p>       -f     Force &#8211; go ahead even if the command is stupid.  This allows the<br />              creation  of  a  swap  area larger than the file or partition it<br />              resides on.  On SPARC, force creation of the swap area.  Without<br />              this  option  mkswap will refuse to create a v0 swap on a device<br />              with a valid SPARC superblock, as that  probably  means  one  is<br />              going to erase the partition table.</p>
<p>       -p PSZ Specify the page size to use.</p>
<p>       -L label<br />              Specify  a label, to allow swapon by label.  (Only for new style<br />              swap areas.)</p>
<p>       -v0    Create an old style swap area.</p>
<p>       -v1    Create a new style swap area.</p>
<p>       If no -v option is given, mkswap will default to new style, but use old<br />       style  if  the  current  kernel  is  older  than  2.1.117  (and also if<br />       PAGE_SIZE is less than 2048).  The new style header does not touch  the<br />       first  block,  so  may be preferable, in case you have a boot loader or<br />       disk label there.  If you need to use both 2.0 and 2.2 kernels, use the<br />       -v0 option when creating the swapspace.</p>
<p>       Version  0  (-v0) swap space format is no longer supported in 2.5+ ker-<br />       nels.</p>
<p>       -U uuid<br />              Specify the uuid to use. The default is to generate UUIDs.</p>
<p>SEE ALSO<br />       fdisk(8), swapon(8)</p>
<p>AVAILABILITY<br />       The mkswap command is part of the util-linux-ng package and  is  avail-<br />       able from <a target="_blank" href="ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/">ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/</a>.</p>
<p>Linux 2.2.4                      25 March 1999                       MKSWAP(8)</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=93a6f892-f7d8-487a-b2ec-6354b3e22c1d" /></div>
<ul class="socialwrap size32 row">
<li class="iconOnly"><a rel="nofollow" target="_blank" class="delicious" href="http://delicious.com/post?url=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;title=MKSWAP" title="Bookmark this post : MKSWAP on Delicious"><span class="head">Bookmark on Delicious</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="digg" href="http://digg.com/submit?url=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;title=MKSWAP&amp;bodytext=MKSWAP%288%29++++++++++++++++++Linux+Programmer%27s+Manual+++++++++++++++++MKSWAP%288%29NAME+++++++mkswap+-+set+up+a+Linux+swap+areaSYNOPSIS+++++++mkswap+%5B-c%5D+%5B-vN%5D+%5B-f%5D+%5B-p+PSZ%5D+%5B-L+label%5D+%5B-U+uuid%5D+device+%5Bsize%5DDESCRIPTION+++++++mkswap+sets+up+a+Linux+swap+area+on+a+device+or+in+a+file.+++++++%28After++creating++the++swap++area%2C" title="Digg this post : MKSWAP"><span class="head">Digg this post</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="facebook" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;t=MKSWAP" title="Recommend this post : MKSWAP on Facebook"><span class="head">Recommend on Facebook</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="google_buzz" href="http://www.google.com/reader/link?url=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;title=MKSWAP" title="Buzz up this post : MKSWAP "><span class="head">Buzz it up</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="yahoo_buzz" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F" title="Buzz up this post : MKSWAP "><span class="head">Buzz it up</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="orkut" href="http://promote.orkut.com/preview?nt=orkut.com&amp;du=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;tt=MKSWAP" title="Share this post : MKSWAP on Orkut"><span class="head">Share on Orkut</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="reddit" href="http://www.reddit.com/submit?url=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;title=MKSWAP" title="Share this post : MKSWAP on Reddit"><span class="head">share via Reddit</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="stumble" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F&amp;title=MKSWAP" title="Share this post : MKSWAP with Stumblers"><span class="head">Share with Stumblers</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="twitter" href="http://twitter.com/home/?status=http%3A%2F%2Fitechlog.com%2Flinux-man-pages%2F2009%2F01%2F01%2Fmkswap%2F" title="Tweet this post : MKSWAP on Twitter"><span class="head">Tweet about it</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="" class="rss" href="http://itechlog.com/linux-man-pages/2009/01/01/mkswap/feed" title="Follow this post : MKSWAP comments"><span class="head">Subscribe to the comments on this post</span></a></li>
<li class="iconOnly"><a rel="" class="email" href="mailto:?subject=iTechLog : MKSWAP&#038;body=here is a link to a site I really like.   http://itechlog.com/linux-man-pages/2009/01/01/mkswap/" title="Tell a friend about this post : MKSWAP "><span class="head">Tell a friend</span></a></li>
</ul>
<div class="clean"></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Linux+Man+Pages' rel='tag' target='_self'>Linux Man Pages</a>, <a class='technorati-link' href='http://technorati.com/tag/MKSWAP' rel='tag' target='_self'>MKSWAP</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>January 4, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/04/sort/" title="SORT">SORT</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/mkdirhier/" title="MKDIRHIER">MKDIRHIER</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/modinfo/" title="MODINFO">MODINFO</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/mkfs/" title="MKFS">MKFS</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/mknod/" title="MKNOD">MKNOD</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/linux-man-pages/2009/01/01/mkswap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
