|
Lines 1156-1199
Link Here
|
| 1156 |
<filename>/usr/swap0</filename>. You can use any name you |
1156 |
<filename>/usr/swap0</filename>. You can use any name you |
| 1157 |
want, of course.</para> |
1157 |
want, of course.</para> |
| 1158 |
|
1158 |
|
| 1159 |
<para>First, be certain that your kernel configuration includes |
1159 |
<example> |
| 1160 |
the vnode driver. It is not in recent versions of |
1160 |
<title>Creating a Swapfile</title> |
| 1161 |
GENERIC.</para> |
|
|
| 1162 |
|
| 1163 |
<programlisting>pseudo-device vn 1 #Vnode driver (turns a file into a device)</programlisting> |
| 1164 |
|
1161 |
|
| 1165 |
<orderedlist> |
1162 |
<orderedlist> |
|
|
1163 |
<listitem> |
| 1164 |
<para>Be certain that your kernel configuration includes |
| 1165 |
the vnode driver. It is <emphasis>not</emphasis> in recent versions of |
| 1166 |
<filename>GENERIC</filename>.</para> |
| 1167 |
|
| 1168 |
<programlisting>pseudo-device vn 1 #Vnode driver (turns a file into a device)</programlisting> |
| 1169 |
</listitem> |
| 1170 |
|
| 1166 |
<listitem> |
1171 |
<listitem> |
| 1167 |
<para>create a vn-device</para> |
1172 |
<para>Create a vn-device:</para> |
| 1168 |
<screen>&prompt.root; <userinput>cd /dev</userinput> &prompt.root; <userinput>sh MAKEDEV vn0</userinput></screen> |
1173 |
<screen>&prompt.root; <userinput>cd /dev</userinput> &prompt.root; <userinput>sh MAKEDEV vn0</userinput></screen> |
| 1169 |
</listitem> |
1174 |
</listitem> |
| 1170 |
|
1175 |
|
| 1171 |
<listitem> |
1176 |
<listitem> |
| 1172 |
<para>create a swapfile (<filename>/usr/swap0</filename>)</para> |
1177 |
<para>Create a swapfile (<filename>/usr/swap0</filename>):</para> |
| 1173 |
|
1178 |
|
| 1174 |
<screen>&prompt.root; <userinput>dd if=/dev/zero of=/usr/swap0 bs=1024k count=64</userinput></screen> |
1179 |
<screen>&prompt.root; <userinput>dd if=/dev/zero of=/usr/swap0 bs=1024k count=64</userinput></screen> |
| 1175 |
</listitem> |
1180 |
</listitem> |
| 1176 |
|
1181 |
|
| 1177 |
<listitem> |
1182 |
<listitem> |
| 1178 |
<para>set proper permissions on (<filename>/usr/swap0</filename>)</para> |
1183 |
<para>Set proper permissions on (<filename>/usr/swap0</filename>)</para> |
| 1179 |
|
1184 |
|
| 1180 |
<screen>&prompt.root; <userinput>chmod 0600 /usr/swap0</userinput></screen> |
1185 |
<screen>&prompt.root; <userinput>chmod 0600 /usr/swap0</userinput></screen> |
| 1181 |
</listitem> |
1186 |
</listitem> |
| 1182 |
|
1187 |
|
| 1183 |
<listitem> |
1188 |
<listitem> |
| 1184 |
<para>enable the swap file in <filename>/etc/rc.conf</filename></para> |
1189 |
<para>Enable the swap file in <filename>/etc/rc.conf</filename>:</para> |
| 1185 |
|
1190 |
|
| 1186 |
<programlisting>swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired.</programlisting> |
1191 |
<programlisting>swapfile="/usr/swap0" # Set to name of swapfile if aux swapfile desired.</programlisting> |
| 1187 |
</listitem> |
1192 |
</listitem> |
| 1188 |
|
1193 |
|
| 1189 |
<listitem> |
1194 |
<listitem> |
| 1190 |
<para>reboot the machine</para> |
1195 |
<para>Reboot the machine or to enable the swap file immediately, |
|
|
1196 |
type:</para> |
| 1197 |
|
| 1198 |
<screen>&prompt.root; <userinput>vnconfig -e /dev/vn0b /usr/swap0 swap</userinput></screen> |
| 1191 |
</listitem> |
1199 |
</listitem> |
| 1192 |
</orderedlist> |
1200 |
</orderedlist> |
| 1193 |
|
1201 |
</example> |
| 1194 |
<para>To enable the swap file immediately, type</para> |
|
|
| 1195 |
|
| 1196 |
<screen>&prompt.root; <userinput>vnconfig -e /dev/vn0b /usr/swap0 swap</userinput></screen> |
| 1197 |
</sect2> |
1202 |
</sect2> |
| 1198 |
</sect1> |
1203 |
</sect1> |
| 1199 |
</chapter> |
1204 |
</chapter> |