coLinux
Register
Advertisement


I will explain how to set-up a swap partition on coLinux.

This is a very important stuff especially for people running a low memory computer.

I assume, that your coLinux is installed and you're already able to run it.

1 - First we need a file of a fixed size which will be used as our swap partition.

The size chosen for this file will determine how large your swap partition is. You can create the file manually, or you can download one of these zipped dummy swapfiles in various sizes provided by <Gniarf> (the filenames indicate the size of the provided file in MB).

2 - You must declare the file as a virtual partition on the default.colinux.xml conf file, see ConfigurationXMLFormat for details.

Here is an example :

<block_device index="1" path="\DosDevices\c:\coLinux\swap-file" enabled="true"/>

Replace c:\coLinux\swap-file by the correct path on your system.

3 - Boot coLinux (reboot if it's already running).

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

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.)

6 - Now, you must initialize the swap partition :

mkswap /dev/cobd1

Again, use '/dev/cobd/1' instead if necessary according to step 4.

7 - Finally, if you want to beneficiate immediately of your swap partition without rebooting the guest system :

swapon -a

8 - You should see a message in the colinux-daemon Command Prompt window about the swap space being added.

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

Advertisement