coLinux
(add category)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Broken by old spam]]
 
 
<!-- '''AddSwapPartition''' -->
 
<!-- '''AddSwapPartition''' -->
   
  +
I will explain how to set up a swap partition on coLinux.
  +
It is an important thing to do, especially if you do not give coLinux access to much memory.
  +
It will be assumed that you have already installed coLinux and that you are able to run it.
   
  +
* First, we need a file of predetermined size which will be used as our swap partition.
9 - After a while, use the <u>free</u> or <u>top</u> command to check that you swap file is actually being used.
 
  +
  +
The size of this file will determine the size of the swap partition. You can [[HowtoCreateSwapFile|create the file manually]], or you can download and unzip one of the [http://gniarf.nerim.net/colinux/swap premade swap files] of various sizes provided by &lt;Gniarf&gt; (the filename indicates the size of the unzipped swap file in megabytes).
  +
  +
* You must declare the file as a virtual partition in your coLinux configuration file (see, for example, the file <tt>example.conf</tt> included with coLinux).
  +
  +
For example:
  +
  +
cobd1=c:\coLinux\swap-file
  +
  +
(If you are using a version of coLinux older than 0.7.1, then the configuration file is called <tt>default.colinux.xml</tt> and the format is completely different;
  +
see [[ConfigurationXMLFormat]] for details.
  +
The example above, for a coLinux older than 0.7.1, becomes <code>&lt;block_device index="1" path="\DosDevices\c:\coLinux\swap-file" enabled="true" /&gt;</code>.)
  +
  +
* Boot up coLinux, or reboot if it is already running.
  +
Among the messages the kernel produces, there should be some mention of <tt>cobd1</tt>,
  +
giving the size of your new (virtual) partition in megabytes.
  +
  +
* Run <tt>ls /dev/cobd1 /dev/cobd/1</tt> to determine which device name your system uses to refer to the swap file.
  +
We will assume in the coming steps that your swap device is <tt>/dev/cobd1</tt>.
  +
  +
* You must add an entry to the file <tt>/etc/fstab</tt>
  +
in your Linux (guest) distribution to declare the swap partition and mount it at each bootup:
  +
  +
/dev/cobd1 swap swap defaults 0 0
  +
  +
(Change the name of the device as necessary.)
  +
  +
(<em>Note:</em> Using the Gentoo image, you can install <tt>vim</tt>
  +
in your running system using the command <tt>emerge vim</tt>.
  +
But you might want to wait until you have added swap space first;
  +
if so, you can just use the pre-installed editor <tt>nano</tt> instead.)
  +
  +
* Initialize the swap partition by running <tt>mkswap /dev/cobd1</tt>.
  +
(If your swap partition was one of those prepared by &lt;Gniarf&gt;,
  +
this step is probably unnecessary.)
  +
  +
* Finally, to make use of your swap partition immediately without
  +
rebooting, run <tt>swapon -a</tt>. You should see a message about
  +
the swap space being added.
  +
  +
Et voilà...
  +
 
* After a while, use <tt>free</tt> or <tt>top</tt> to see whether your swap file is actually being used.
   
 
----[[MassTranslated]] on Sun Apr 23 17:35:30 UTC 2006
 
----[[MassTranslated]] on Sun Apr 23 17:35:30 UTC 2006
  +
(updated and reworded a little by an anonymous user on 22 February 2008)
 
[[Category:Configuration]]

Latest revision as of 17:20, 15 June 2008


I will explain how to set up a swap partition on coLinux. It is an important thing to do, especially if you do not give coLinux access to much memory. It will be assumed that you have already installed coLinux and that you are able to run it.

  • First, we need a file of predetermined size which will be used as our swap partition.

The size of this file will determine the size of the swap partition. You can create the file manually, or you can download and unzip one of the premade swap files of various sizes provided by <Gniarf> (the filename indicates the size of the unzipped swap file in megabytes).

  • You must declare the file as a virtual partition in your coLinux configuration file (see, for example, the file example.conf included with coLinux).

For example:

cobd1=c:\coLinux\swap-file

(If you are using a version of coLinux older than 0.7.1, then the configuration file is called default.colinux.xml and the format is completely different; see ConfigurationXMLFormat for details. The example above, for a coLinux older than 0.7.1, becomes <block_device index="1" path="\DosDevices\c:\coLinux\swap-file" enabled="true" />.)

  • Boot up coLinux, or reboot if it is already running.

Among the messages the kernel produces, there should be some mention of cobd1, giving the size of your new (virtual) partition in megabytes.

  • Run ls /dev/cobd1 /dev/cobd/1 to determine which device name your system uses to refer to the swap file.

We will assume in the coming steps that your swap device is /dev/cobd1.

  • You must add an entry to the file /etc/fstab

in your Linux (guest) distribution to declare the swap partition and mount it at each bootup:

/dev/cobd1    swap    swap    defaults    0    0

(Change the name of the device as necessary.)

(Note: Using the Gentoo image, you can install vim in your running system using the command emerge vim. But you might want to wait until you have added swap space first; if so, you can just use the pre-installed editor nano instead.)

  • Initialize the swap partition by running mkswap /dev/cobd1.

(If your swap partition was one of those prepared by <Gniarf>, this step is probably unnecessary.)

  • Finally, to make use of your swap partition immediately without

rebooting, run swapon -a. You should see a message about the swap space being added.

Et voilà...

  • After a while, use free or top to see whether your swap file is actually being used.

MassTranslated on Sun Apr 23 17:35:30 UTC 2006

(updated and reworded a little by an anonymous user on 22 February 2008)