From owner-svn-doc-all@FreeBSD.ORG Tue May 6 14:18:28 2014 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97854E80; Tue, 6 May 2014 14:18:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 840DA6D1; Tue, 6 May 2014 14:18:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46EISjh036097; Tue, 6 May 2014 14:18:28 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46EISgd036096; Tue, 6 May 2014 14:18:28 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201405061418.s46EISgd036096@svn.freebsd.org> From: Dru Lavigne Date: Tue, 6 May 2014 14:18:28 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44770 - head/en_US.ISO8859-1/books/handbook/config X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:18:28 -0000 Author: dru Date: Tue May 6 14:18:28 2014 New Revision: 44770 URL: http://svnweb.freebsd.org/changeset/doc/44770 Log: Editorial review of Swap Space section. This really belongs in the Storage chapter and should have a reference for ZFS swap. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/config/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/config/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/config/chapter.xml Tue May 6 13:38:06 2014 (r44769) +++ head/en_US.ISO8859-1/books/handbook/config/chapter.xml Tue May 6 14:18:28 2014 (r44770) @@ -2703,9 +2703,9 @@ kern.maxvnodes: 100000 Adding Swap Space - Sometimes a system requires more swap space. There are - three ways to increase swap space: add a new hard drive, - enable swap over NFS, or create a swap file + Sometimes a system requires more swap space. This section + describes two methods to increase swap space: adding swap to an + existing partition or new hard drive, and creating a swap file on an existing partition. For information on how to encrypt swap space, which options @@ -2713,16 +2713,16 @@ kern.maxvnodes: 100000 . - Swap on a New or Existing Hard Drive + Swap on a New Hard Drive or Existing Partition Adding a new hard drive for swap gives better performance - than adding a partition on an existing drive. Setting up + than using a partition on an existing drive. Setting up partitions and hard drives is explained in while discusses partition layouts and swap partition size considerations. - Use &man.swapon.8; to add a swap partition to the system. + Use swapon to add a swap partition to the system. For example: &prompt.root; swapon /dev/ada1s1b @@ -2730,10 +2730,10 @@ kern.maxvnodes: 100000 It is possible to use any partition not currently mounted, even if it already contains data. Using - &man.swapon.8; on a partition that contains data will + swapon on a partition that contains data will overwrite and destroy that data. Make sure that the partition to be added as swap is really the intended - partition before running &man.swapon.8;. + partition before running swapon. To automatically add this swap partition on boot, add an @@ -2742,34 +2742,26 @@ kern.maxvnodes: 100000 /dev/ada1s1b none swap sw 0 0 See &man.fstab.5; for an explanation of the entries in - /etc/fstab. - - - - Swapping over <literal>NFS</literal> - - Swapping over NFS is only recommended - when there is no local hard disk to swap to. - NFS swapping will be limited by the - available network bandwidth and puts an additional burden - on &man.nfsd.8;. + /etc/fstab. More information about + swapon can be found in + &man.swapon.8;. - Swapfiles + Creating a Swap File - To create a swap file, specify its size. The following + To instead create a swap file, specify its size. The following example creates a 64MB file named /usr/swap0. - Creating a Swapfile on &os; + Creating a Swap File on &os; The GENERIC kernel already - includes the memory disk driver (&man.md.4;) required - for this operation. When building a custom kernel, + includes the required memory disk driver. + When building a custom kernel, make sure to include the following line in the custom configuration file: @@ -2780,31 +2772,33 @@ kern.maxvnodes: 100000 - First, create the swapfile + Create the swap file, /usr/swap0: - &prompt.root; dd if=/dev/zero of=/usr/swap0 bs=1024k count=64 + &prompt.root; dd if=/dev/zero of=/usr/swap0 bs=1024k count=64 Then, set proper permissions on /usr/swap0: - &prompt.root; chmod 0600 /usr/swap0 + &prompt.root; chmod 0600 /usr/swap0 Enable the swap file in /etc/rc.conf: - swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired. + swapfile="/usr/swap0" # Set to name of swap file - Reboot the machine or, to enable the swap file - immediately, type: + To enable the swap file + immediately, specify a free memory device. Refer to + for more information + about memory devices. - &prompt.root; mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0 + &prompt.root; mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0