Can't use a swap file in the nand


asimov-solensan

Very Active Member
Joined
Jan 8, 2010
Messages
734
Hello, I have installed super-zaxxon beta3 and since it leaves 150MB of free space in the nand I wanted to try use this space as a 64MB or more swap file. And yes, I am aware of all the dangers and drawbacks that this implies.


The problem is that I can't do it the way I do with the swapfile I used in an sd. Whenever I try swapon responds with: "swapon failed: Invalid argument"


I have tried putting the file in different locations like my home or the root but got the same result.


Any ideas?
 
Last edited by a moderator:
Really, you won't do that...


As you know, it wears the nand very quickly and the nand is slower than a fast sdcard, so well. What benefit do you think this would have?


Just out of curiosity.
 
sd card only m8 youll destroy the nand works brill for me on a cheap 1gb sandisk sd
 
Try zram:





And if it doesn't fit your needs, then "destroy" your nand ^^.
 
Did you remember to mkswap the file first? That's typically what most people forget when creating a swap file.



Code:
dd if=/dev/zero of=/swapfile bs=1024 count=32768

mkswap /swapfile

swapon /swapfile
 
@wizardstan of couse I did.


Ha ha, I know what I'm doing and I don't want to have it enabled forever just wanted to try how it behaves. It really surprises me what mcobit says, how can the nand be slower than an sd? furthermore when access to sd cards is limited by the controller. I thought that the point of having an expensive internal memory was because it was a lot faster than a replaceable one.


I might try that zram thing.


Thanks for the answers.
 
Try:


swapon -v /swapfile


Should be verbose.

+1


There are dozens of reasons NOT to do this. It looks like they were covered above.


In the interest of freedom of choice to hack this open device to your own whims though:


I'm not sure of a utility that would allow you to re-partition the on-board NAND to create a true /swap partition. The swapon utility allows you to do it using a file target though.


To enable swapon to write to NAND you'll likely need to be root at the time. Let us know how it works out.


Disclaimer: Doing this to your NAND for a long time could result in bricking your Pandora. You're on your own on that one.
 
Adding the verbose output complained about the file permissions but once fixed the result is the same:


openpandora:~$ sudo swapon -v swapfile.swp


swapon on swapfile.swp


swapon: /home/asimov/swapfile.swp: found swap signature: version 1, page-size 4, same byte order


swapon: /home/asimov/swapfile.swp: pagesize=4096, swapsize=101711872, devsize=101711872


swapon: swapfile.swp: swapon failed: Invalid argument


openpandora:~$
 
Back
Top