Difference between revisions of "Swap"

From Pandora Wiki
Jump to: navigation, search
m (Created page with "TODO When installing SuperZaxxon Final, its first boot does not have zRam enabled. Reboot to have it automatically enabled. To determine if you have swap enabled, run <tt>fre...")
 
(Added instructions on how to enable a swap partition on an SD card.)
 
Line 1: Line 1:
 +
{{warning
 +
|Having a swap partition or a swap file on a Flash based storage medium is a highly controversial topic. Swaping can substantially shorten the life-time of the storage-medium.
 +
}}
 +
Modern wear-leveling-algorithms can compensate some of the disadvantages.
 +
{{note
 +
|Note: For swaping, the speed of the flash card is more important than it is in other areas such as storing data or even games! A faster card can drastically improve the speed of swaping and therefore the speed of your OS.
 +
}}
 +
By default, the OpenPandora does not have swaping enabled at all.
 +
{{note
 +
|If you're primarily using the Pandora for gaming, enabling swap won't bring you any advantages. It will, however, make the Pandora more usable as a general computing device, as it makes running more applications simultaneously possible.
 +
}}
 +
 +
== How much swap ==
 +
It's hard to say how much swap your system should provide. As a hint: The Nokia N900, which is also a Linux based Handheld and comes with 256MB RAM, has a 768MB swap partition enabled by default.
 +
 +
== Swap partition ==
 +
In Linux computing, the standard is to have a separate partition for swaping. The (hexadecimal) partition type ID for a swap partition is 0x82.
 +
On your flashcard, create a partition with that partition type. Let's take the example from here http://pandorawiki.org/Running_Linux_from_an_SD_card, where you're having a swap partition as the third partition on the first SD card.
 +
First we have to 'format' the partition to be a swap partition. As a root-user, you can do that with the command line tool mkswap
 +
<source lang="bash">
 +
sudo su
 +
mkswap /dev/mmcblk0p3
 +
</source>
 +
After that, you have to enable the swap partition. You can do that with the swapon tool
 +
<source lang="bash">
 +
swapon /dev/mmcblk0p3
 +
</source>
 +
To enable the swap partition on boot, we have to add an entry to the /etc/fstab file. In our example, the line would look something like that:
 +
<source lang="bash">
 +
/dev/mmcblk0p3    none    swap    sw    0 0
 +
</source>
 +
After the reboot, use a tool such as swapon or top to determine wether the swap partition is enabled:
 +
<source lang="bash">
 +
swapon -s
 +
</source>
 +
== Swap file ==
 
TODO
 
TODO
 
  
 
When installing SuperZaxxon Final, its first boot does not have zRam enabled.  Reboot to have it automatically enabled.
 
When installing SuperZaxxon Final, its first boot does not have zRam enabled.  Reboot to have it automatically enabled.
  
 
To determine if you have swap enabled, run <tt>free</tt> or <tt>swapon -s</tt>
 
To determine if you have swap enabled, run <tt>free</tt> or <tt>swapon -s</tt>

Latest revision as of 10:55, 5 July 2012



Modern wear-leveling-algorithms can compensate some of the disadvantages.


By default, the OpenPandora does not have swaping enabled at all.


How much swap

It's hard to say how much swap your system should provide. As a hint: The Nokia N900, which is also a Linux based Handheld and comes with 256MB RAM, has a 768MB swap partition enabled by default.

Swap partition

In Linux computing, the standard is to have a separate partition for swaping. The (hexadecimal) partition type ID for a swap partition is 0x82. On your flashcard, create a partition with that partition type. Let's take the example from here http://pandorawiki.org/Running_Linux_from_an_SD_card, where you're having a swap partition as the third partition on the first SD card. First we have to 'format' the partition to be a swap partition. As a root-user, you can do that with the command line tool mkswap

sudo su
mkswap /dev/mmcblk0p3

After that, you have to enable the swap partition. You can do that with the swapon tool

swapon /dev/mmcblk0p3

To enable the swap partition on boot, we have to add an entry to the /etc/fstab file. In our example, the line would look something like that:

/dev/mmcblk0p3    none    swap    sw    0 0

After the reboot, use a tool such as swapon or top to determine wether the swap partition is enabled:

swapon -s

Swap file

TODO

When installing SuperZaxxon Final, its first boot does not have zRam enabled. Reboot to have it automatically enabled.

To determine if you have swap enabled, run free or swapon -s