Reply
Thread Tools
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#91
Actually I tried the -q and it didn't work for me (Gives a long warning about paritition table cylinders), but it couldn't hurt to add it to the script, will do.
__________________
"Impossible is not in the Maemo vocabulary" - Caballero
 
Posts: 32 | Thanked: 24 times | Joined on Sep 2010
#92
Sorry your right the -q does nothing (warnings scrolled past top of screen on N900, was doing things remotely till now).

What does work is if you use the switch for msdos mode, -d, it returns a similar list except that now now the linux swap is listed as Id=82, so we can use this instead.

Code:
start on started hildon-desktop
stop on starting shutdown
console none
service

script

drivelist=$(sfdisk -lnd /dev/mmcblk1)
swapmicro=$(echo "$drivelist" -n | grep Id=82 | awk '/mmcblk1/ {print $1}')
if [ "$swapmicro" ]; then
    swapon $swapmicro
    swapoff /dev/mmcblk0p3
    swapon /dev/mmcblk0p3
fi

end script
That works cleanly for me with no warning messages, though I have only ran it in a test script where I echo "$swapmicro" and it returns:
/dev/mmcblk1p2

I have also changed the awk part, so that instead of looking for the specific swap partition /mmcblk1p2/, it looks for the more general swap on /mmcblk1/.
I think this is what Whitewolf was suggesting in case people have their cards partitioned differently.
I think thats it now - ready to go?

EDIT: I have tested this now by adding to /etc/event.d/ and it works as expected. On reboot with no card present no swap changes are made. With swap on SD present it enables swap with the faster memory having a higher priority.

If you are going to do this I'd suggest putting it in file on its own - or if you are adding this to an existing tuning script, put it at the end as it will exit when no external swap is detected.
(Many thanks GameboyRMH and Whitewolf, this noob has learned a lot working on this with you)

Last edited by elipsoid; 2010-10-21 at 04:22. Reason: Have tested it now
 

The Following 3 Users Say Thank You to elipsoid For This Useful Post:
Posts: 3,664 | Thanked: 1,530 times | Joined on Sep 2009 @ Hamilton, New Zealand
#93
Great stuff.. Might do this later on when I'm ready.

Thanks
 
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#94
I love, has been very clean script.

I will try.
 
Posts: 106 | Thanked: 136 times | Joined on Apr 2010 @ Switzerland
#95
Finally I think what we need for N900 is a 512 Mb RAM chip behind a SD controler with microSD format.
For swap only, there is no need of persistence as it remains on voltage.

Question: what is the best way to benchmark N900 and collect perf stats, specifically about swap usage ?
 
preflex's Avatar
Posts: 172 | Thanked: 628 times | Joined on Apr 2010 @ Albuquerque, NM, USA
#96
I set up a 768 MB swap partition on p3 of my class 6 MicroSD using gparted on my laptop.

I set up two Queen BeeCON widgets:
Widget one:
Command Name: MicroSD Swap On
Command: sudo swapon /dev/mmcblk1p3 && sudo swapoff /dev/mmcblk0p3

Widget two:
Command Name: MicroSD Swap On
Command: sudo swapon /dev/mmcblk0p3 && sudo swapoff /dev/mmcblk1p3

I seem to get much better easydebian performance with this (I also installed easy debian to a 6GB ext3 partition to increase performance and app space). It's nice to be able to switch it off, If I want to remove the microsd for whatever reason. I've noticed performance gains using optified programs as well as in easy debian, presumably due to having swap on a seperate disk.

It takes a while for swapoff to run. To monitor progress, I watch it in conky. Once the total swap size gets back down to 768, it's done.

I'm sure there's a much better way to do this, but this was very easy and convenient. This is somewhat unsafe, as it doesn't check to make sure mmcblk1p3 is actually present. If mmcblk1p3 is not present, and you have more memory used in swap than you have free RAM, it will be ugly.

Last edited by preflex; 2010-12-30 at 11:01.
 
Posts: 1 | Thanked: 0 times | Joined on Jan 2011
#97
Hello!

I'm not too familiar with Linux yet but I'd like to try to enlarge the capacity of swap memory and learn more. I have read couple Threads here about this issue and I just like to know which of these solutions posted here are the latest and safest? So if someone could reply here or send me a private message which contains the necessary commands in a compressed form. Or is the wiki for that already telling it in that way (so there isn't something else I should do or know)

Thank you
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#98
The easiest and safest solution is to first put this script in /etc/event.d:

Code:
start on started hildon-desktop
stop on starting shutdown
console none
service

script

drivelist=$(sfdisk -lnd /dev/mmcblk1)
swapmicro=$(echo "$drivelist" -n | grep Id=82 | awk '/mmcblk1/ {print $1}')
if [ "$swapmicro" ]; then
    swapon $swapmicro
    swapoff /dev/mmcblk0p3
    swapon /dev/mmcblk0p3
fi

end script
Then backup your MicroSD card, and reformat it (Gparted is a good graphical tool to use) with the FAT32 partition as the first partition, and the linux swap partition as the second (whatever size you choose, 384 or 768MB are good sizes). Then put your data back.

And that's it. Totally safe and easy.
__________________
"Impossible is not in the Maemo vocabulary" - Caballero
 
Posts: 32 | Thanked: 24 times | Joined on Sep 2010
#99
Welcome Misferatu.
As gameboy says above it's as simple as correctly formating your SD and running that script at startup (which it will do automatically when you save it to /etc/event.d ) .
I'd say 384mb is a good bet, as I personally haven't ever seen the swap spill over that, the default 786mb swap the n900 originally came with is massive overkill - and remember that original swap will still be available if you do manage to fill the swap you created on the SD card.
 
Posts: 7 | Thanked: 2 times | Joined on Dec 2010
#100
hii frnds .
i want to ask that if we overclock our device to 1Ghz.
then will it give better performance with the swapable virtual memory?
 
Reply


 
Forum Jump


All times are GMT. The time now is 04:43.