coLinux
m (Fixed links too)
(add category)
 
(7 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.
+
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.
This is a very important stuff especially for people running a low memory computer.
 
   
 
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).
I assume, that your coLinux is installed and you're already able to run it.
 
   
  +
* 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).
1 - First we need a file of a fixed size which will be used as our swap partition.
 
   
 
For example:
The size chosen for this file will determine how large your swap partition is. You can [[
 
HowtoCreateSwapFile|create the file manually]], or you can [[http://gniarf.nerim.net/colinux/swap|download]] one of these zipped dummy swapfiles in various sizes provided by <Gniarf> (the filenames indicate the size of the provided file in MB).
 
   
  +
cobd1=c:\coLinux\swap-file
2 - You must declare the file as a virtual partition on the default.colinux.xml conf file, see [[ConfigurationXMLFormat]] for details.
 
   
  +
(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;
Here is an example :
 
  +
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.
<block_device index="1" path="\DosDevices\c:\coLinux\swap-file" enabled="true"/>
 
  +
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.
Replace c:\coLinux\swap-file by the correct path on your system.
 
  +
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>
3 - Boot coLinux (reboot if it's already running).
 
 
in your Linux (guest) distribution to declare the swap partition and mount it at each bootup:
   
You should see a message in that window about cobd1 giving the size of the "partition" in MB.
 
 
4 - Type
 
ls /dev/cobd1
 
 
at the command prompt. If you get a ls: /dev/cobd1: No such file or directory error message, try ls /dev/cobd/1 instead. Whichever one succeeds should be used in the next two steps.
 
 
5 - You must add an entry on your Linux guest distribution in /etc/fstab in order to declare the swap partition and mount it at boot-time.
 
 
/dev/cobd1 swap swap defaults 0 0
 
/dev/cobd1 swap swap defaults 0 0
   
  +
(Change the name of the device as necessary.)
where 1 stands for the number of the block_device index as declared in the coLinux XML conf file. Change it if necessary. Also remember to add the slash if necessary, according to step 4. (NOTE: Using the Gentoo image, you can add vim to your running system via the command 'emerge vim', but you may need to add swap space first before doing this. If you don't want to do this, use the 'nano' editor instead.)
 
   
  +
(<em>Note:</em> Using the Gentoo image, you can install <tt>vim</tt>
6 - Now, you must initialize the swap partition :
 
  +
in your running system using the command <tt>emerge vim</tt>.
mkswap /dev/cobd1
 
  +
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>.
Again, use '/dev/cobd/1' instead if necessary according to step 4.
 
  +
(If your swap partition was one of those prepared by &lt;Gniarf&gt;,
  +
this step is probably unnecessary.)
   
7 - Finally, if you want to beneficiate immediately of your swap partition without rebooting the guest system :
+
* Finally, to make use of your swap partition immediately without
  +
rebooting, run <tt>swapon -a</tt>. You should see a message about
swapon -a
 
  +
the swap space being added.
   
 
Et voilà...
8 - You should see a message in the colinux-daemon Command Prompt window about the swap space being added.
 
   
 
* After a while, use <tt>free</tt> or <tt>top</tt> to see whether your swap file is actually being used.
Et voilà...
 
   
9 - After a while, use the free or top command to check that you 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)