Proper usage of a Swap File?


Orion4874

Mega GP Mania
Joined
May 17, 2009
Messages
1,426
Age
50
Location
North Brunswick, New Jersey
I have a couple general questions about creating and using swap files on the Panda. I'm using the Swap Files tool to create the swap and it is saved to the /swaptools folder. Should the file always stay there or does it have to be moved to the appdata folder of whatever program you're using it for? Also, do you always have to reactivate the file or does it just remain active until you power down or restart? Should I deactivate it when not needing it?

Thanks in advance for the info guys!
 
The file doesn't need to be moved. You have to reactivate it each boot (I did until I added a script to bootup that auto-activated it for me).

AFAIK, it won't do you any harm leaving it active all the time.
 
(I did until I added a script to bootup that auto-activated it for me).
May I have a copy of this script?
I don't have my Pandora with me, but I'm pretty sure it's just a "swapon /media/Data/swapfile.swp", but the script is then added to sudoers and I can't even remember how you add it to the boot stage. If I remember later, I'll dig it out, but it's nothing complicated
 
I added this to my etc/fstab

/media/SDCARDNAME/swap none swap sw 0 0
Or this :
Code:
/media/SDCARDNAME/swap swap swap defaults 0 0
SDCARNAME : is the name of your SD or mmcblk0p1 for example.


Rename swap with the name of your swap file, for example :

Code:
/media/mmcblk0p1/swapfile1 swap swap defaults 0 0
 
Last edited by a moderator:
If you do this you really /need/ to always have that sd card with the swap inserted. I don't remember what happens when you don't have it inserted at boot with this in the fstab, it might not even boot.
 
Alternatively, you can add the line

sudo swapon /media/Data/swapfile.swp

to the "~/.profile" file. You can use smart sudo to add swapon to sudoers.
 
Last edited by a moderator:
Back
Top