Active Topics

 



Notices


Reply
Thread Tools
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#71
Exactly.
But (aimed at maintainer) there is another solution for avoiding the need of BB power's iostat:
Code:
#!/bin/sh

disk=mmcblk1p1
blocks=$(awk '{if ($3=="'"$disk"'") print $10}' /proc/diskstats)
echo $blocks blocks
let bytes=$blocks*512
echo $bytes bytes
let kb=$bytes/1024
let mb=$bytes/1024/1024
let gb=$bytes/1024/1024/1024
echo $kb kb, $mb mb, $gb gb
We should rely on bytes here, as shell calculations are integer wise.
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 107 | Thanked: 173 times | Joined on Feb 2011
#72
How is ereswap compatible with the double microsd swap switch discussed here ?
 
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#73
Originally Posted by pierrem View Post
How is ereswap compatible with the double microsd swap switch discussed here ?
This is a separate discussion regarding a manual alternative method of reducing flash wear from swap.
My idea was to have two scripts one for switching swap between two SD locations (swap refresh) and one for ejecting swap (moving swap to device so back cover can be removed).
Also there is a upstart script there to load swap to SD at startup, this is to go in event.d

Then to have a GUI with two buttons to run each script.
However it's still a WIP due to me not being a coder and after spending a lot of time going nowhere, it's gone on the backburner.

In summary, the scripts on that discussion aren't fully tested and are not relevant to ereswap.

In ereswap it uses it's config file (see OP) to set locations of swap.

Also you may want to check out SwapSet.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following 2 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 92 | Thanked: 95 times | Joined on Feb 2010 @ Smyrna, Atlanta / Bangalore, India
#74
Hi ,

I followed instructions to configure microsd card for swapping and then installed ereswap and followed ereswap related instructions.

I am facing the below problems.

Freswap is giving the below error
Nokia-N900:~# freswap
swapon: /dev/mmcblk0p3: Device or resource busy
swapoff: /dev/mmcblk1p2: Invalid argument
swapon: /dev/mmcblk1p2: Invalid argument


Nokia-N900:~# ereswap
Not needed, we have 700 MB left.
Nokia-N900:~#

Fdisk output for micro sd:
Nokia-N900:~# fdisk -l /dev/mmcblk1

Disk /dev/mmcblk1: 15.9 GB, 15931539456 bytes
4 heads, 16 sectors/track, 486192 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/mmcblk1p1 1 473023 15136728 c Win95 FAT32 (LBA)
/dev/mmcblk1p2 473024 486192 421408 82 Linux swap

Swapon command is also failing.

Nokia-N900:~# swapon /dev/mmcblk1p2
swapon: /dev/mmcblk1p2: Invalid argument

Edit: Working now after executing below two commands:
mkswap /dev/mmcblk1p2 #prepare the swap partition
swapon /dev/mmcblk1p2 #enable the swap partition


Thanks @Estel and others for your effort on this.

Please help.

Last edited by bipinbn; 2012-09-23 at 23:55.
 

The Following 2 Users Say Thank You to bipinbn For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#75
I'm glad, that You've found it Yourself, and it works for You now. As said in instructions, ereswap doesn't create swap partitions - it use them.

Of course, adding functionality of mkswap'ing partitions defined in config files would be trivial, but benefits are negligible, compared to risk, of bombing out, lets say, /home/ + opt, due to some bug, or who knows what. Actually, this part is so trivial (single command) and so rarely used, that I prefer mkswap'ing by hand.

/Estel

//Edit

Thanks for all suggestions of improvements, everyone. I'll try to implement it if I'll find some free time - which is quite hard now, as I'm pretty occupied by real life, and all of my "scavenged" free time goes to backcover/body replacement project.

Yet, I'm not ignoring comments here, and haven't forget about this little tool
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 
Posts: 92 | Thanked: 95 times | Joined on Feb 2010 @ Smyrna, Atlanta / Bangalore, India
#76
Thanks Estel,

I have been using this since yesterday and I ran into issue where it is continuously throwing up "Not enough memory" and "Operation temporarily disabled due to low memory" and "Too many application. Please close some and try again".

This is happening repeatedly after i open 5+ applications. After I close all the applications and do a freswap it works for upto 5 applications and again the same issue.

I suspected rootfs space and cleared it up. I now have 61 MB free.
>>ereswap command shows 700 MB free

I have created a swap partion of 412 MB on microsd for this. Is this the culprit here. Should i increase this. Please let me know.
 
Posts: 805 | Thanked: 1,605 times | Joined on Feb 2010 @ Gdynia, Poland
#77
Originally Posted by bipinbn View Post
I have created a swap partion of 412 MB on microsd for this. Is this the culprit here. Should i increase this. Please let me know.
I can answer, this is too little. You should create swap partition with at least 768 MB, that's stock swap's size and Fremantle was designed with this amount of memory (256MB RAM + 768MB swap = 1GB) in mind, so you shouldn't have less.
 

The Following 3 Users Say Thank You to misiak For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#78
Almost exactly
I think a 600MB swap will be sufficient (not tested by myself, but stated somewhat earlier in this or another swap thread).

But starting with at least 768MB is best approach. And even better use 1 or 1.5 or more (depending on size of SD), this will decrease number of swap changes/defragmentations.
And the best will be to have two SD swaps (freeing eMMC from swap completely).
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 2,292 | Thanked: 4,135 times | Joined on Apr 2010 @ UK
#79
Originally Posted by misiak View Post
I can answer, this is too little. You should create swap partition with at least 768 MB, that's stock swap's size and Fremantle was designed with this amount of memory (256MB RAM + 768MB swap = 1GB) in mind, so you shouldn't have less.
QFA - Anything less than stock is asking for trouble.
However you can go larger to a point.

I use two 800MB swaps and switch between them as required.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following 2 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 92 | Thanked: 95 times | Joined on Feb 2010 @ Smyrna, Atlanta / Bangalore, India
#80
I think we need to update the wiki then:

http://wiki.maemo.org/Swap_on_microSD#Ereswap

I read the below there:

The microSD card must be split into at least 2 partitions. The first one should be FAT32 (vfat) formatted and the second one must be formatted for linux swap (type 82) and about 384 MB in size

Thats the reason I made a swap partion of ~400MB. Was my understanding wrong ?
 
Reply

Tags
ereswap, fragmentation, microsd, swappiness, swaps


 
Forum Jump


All times are GMT. The time now is 21:00.