| 71 | == Adding a swapfile == |
| 72 | If you have a live system which you need to give extra swapspace too without a reboot, then can add a swapfile. |
| 73 | |
| 74 | Note that a swapfile is much slower than a swap partition, which is -of course- slower than memory. The reason for this is to save the ship when the boat's going down, not increase preformance. |
| 75 | |
| 76 | Create file: |
| 77 | {{{ |
| 78 | dd if=/dev/zero of=/swapfile count=[size of swap, in 512B blocks] |
| 79 | }}} |
| 80 | Format it: |
| 81 | {{{ |
| 82 | mkswap /swapfile -p 16384 |
| 83 | }}} |
| 84 | Tell the kernel to use it at an lower priority (i.e. only use when swap parition is full): |
| 85 | {{{ |
| 86 | swapon -p 16384 /swapfile |
| 87 | }}} |
| 88 | |
| 89 | |