Put in remaining pages and wiki contents.
[ikiwiki.git] / docs / handbook / handbook-adding-swap-space.mdwn
1 \r
2 \r
3 ## 6.14 Adding Swap Space \r
4 \r
5 No matter how well you plan, sometimes a system does not run as you expect. If you find you need more swap space, it is simple enough to add. You have three ways to increase swap space: adding a new hard drive, enabling swap over NFS, and creating a swap file on an existing partition.\r
6 \r
7 ### 6.14.1 Swap on a New Hard Drive \r
8 \r
9 The best way to add swap, of course, is to use this as an excuse to add another hard drive. You can always use another hard drive, after all. If you can do this, go reread the discussion about swap space in [configtuning-initial.html Section 6.2] for some suggestions on how to best arrange your swap.\r
10 \r
11 ### 6.14.2 Swapping over NFS \r
12 \r
13 Swapping over NFS is only recommended if you do not have a local hard disk to swap to. Even though DragonFly has an excellent NFS implementation, NFS swapping will be limited by the available network bandwidth and puts an additional burden on the NFS server.\r
14 \r
15 ### 6.14.3 Swapfiles \r
16 \r
17 You can create a file of a specified size to use as a swap file. In our example here we will use a 64MB file called `/usr/swap0`. You can use any name you want, of course.\r
18 \r
19  **Example 6-1. Creating a Swapfile** \r
20 \r
21   1. Be certain that your kernel configuration includes the vnode driver. It is ***not*** in recent versions of `GENERIC`.\r
22       \r
23       pseudo-device   vn 1   #Vnode driver (turns a file into a device)\r
24   \r
25   1. Create a vn-device:\r
26       \r
27       # cd /dev\r
28       # sh MAKEDEV vn0\r
29   \r
30   1. Create a swapfile (`/usr/swap0`):\r
31       \r
32       # dd if#/dev/zero of/usr/swap0 bs=1024k count=64\r
33   \r
34   1. Set proper permissions on (`/usr/swap0`):\r
35       \r
36       # chmod 0600 /usr/swap0\r
37   \r
38   1. Enable the swap file in `/etc/rc.conf`:\r
39       \r
40       swapfile="/usr/swap0"   # Set to name of swapfile if aux swapfile desired.\r
41   \r
42   1. Reboot the machine or to enable the swap file immediately, type:\r
43       \r
44       # vnconfig -e /dev/vn0b /usr/swap0 swap\r
45   \r
46 \r
47 \r
48 \r
49 CategoryHandbook\r
50 CategoryHandbook-configuration\r