Active Topics

 


Reply
Thread Tools
Posts: 118 | Thanked: 15 times | Joined on Jul 2010
#71
Originally Posted by somekeystrokes View Post
the last line seems to give me an error saying invalid argument!

what to do?
I have a 4gb card!
have you install nitdoird ?

i do install nitdroid last time and i face the same problem with you ,since there was a reply tell us that we should try "/mmcblk1p2"
instead of " mmcblk1p1"

and it work!!
 
kevinp93's Avatar
Posts: 115 | Thanked: 43 times | Joined on May 2010 @ UK, London
#72
Originally Posted by rewt View Post
For those who need more VM, and wish to use their entire MicroSD card for this purpose:

(WARNING: This will erase the entire MicroSD card, or worse, some or all of your internal memory if you mistype the device name.. If you plan to proceed, I recommend that you have some idea what you are doing)

In x-term:

Code:
sudo gainroot
mkswap /dev/mmcblk1p1
swapon /dev/mmcblk1p1
The last line will have to be rerun each time your device is rebooted, unless you add an init script to run it.
Hello.

I have installed Nitdroid on my Micro-SD card, and Nitdroid has partitioned my Sd card and I have approx 2GB free. Can I use these 2GB as 'virtual ram'? Thanks
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#73
Hey, I got an idea, I thought I'd get a second opinion before trying it through.

To work around Maemo 5's swapon's inability to mount swap files with a specific priority, what if we copy Debian's swapon tool to /usr/sbin/debswapon, and change genfstab.awk to use that instead? Seems like it should work.

Edit: Did some experiments and the Debian swapon won't run on Maemo that easily.
__________________
"Impossible is not in the Maemo vocabulary" - Caballero

Last edited by GameboyRMH; 2010-09-24 at 18:53.
 
Posts: 4 | Thanked: 0 times | Joined on Oct 2010
#74
i just create startup script using this command :

Start on started hildon-desktop
stop on starting shutdown
console none
service

script
sleep 60
swapon /dev/mmcblk1p2
end script



and put it under /etc/init.d but still not working after reboot....
why???
 
Posts: 32 | Thanked: 24 times | Joined on Sep 2010
#75
OK, here is another way to enable both swap partitions, this way the faster microSD partition has the higher priority - only using the internal swap when it becomes full.

I've only started messing around with this Linux stuff, so if I'm wrong your comments are welcome. However it really seemed to have worked for me, I had setup a solitary swap of about 350MB and started to get sporadic low memory warnings (but conky did not show any problems), especially when using firefox with a bunch of other apps opened at the same time. After doing this I cannot recreate the memory warnings no matter how hard I try

Simply this:
Code:
 
       swapon /dev/mmcblk1p2
       swapoff /dev/mmcblk0p3
       swapon /dev/mmcblk0p3
Checking
Code:
cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/mmcblk0p3                          partition       786424  0       -2
/dev/mmcblk1p2                          partition       359868  476     -1
From the above you can see the swap on the microSD is higher priority than the one on the internal, and so should in theory be used consecutively when the partition on the removable card becomes full.
 

The Following User Says Thank You to elipsoid For This Useful Post:
Posts: 3,664 | Thanked: 1,530 times | Joined on Sep 2009 @ Hamilton, New Zealand
#76
i've read from YDL that using memory card flash memory as virtual swap Ram will reduce the life of the flash chip by a lot. So I guess it can be done but not the most efficient way to do it.

YDL = Yellow dog linux.
I was planned to use my memory card as SWAP on my PS3 back then.
 
Posts: 32 | Thanked: 24 times | Joined on Sep 2010
#77
Originally Posted by maxximuscool View Post
using memory card flash memory as virtual swap Ram will reduce the life of the flash chip by a lot..
This is true, there are only a finite number of write cycles each memory block can achieve on a flash device. Modern solid state drives use special algorithms to minimise the amount of times each block is written to, extending the life of the device when used as a main computer drive (with swap).

I know that this would not be implemented on the n900's SD, and so placing the swap there will affect the life of the card. However the amount of write cycles has increased massively from what was achievable on early devices where this was a real issue, and we must remember that the default swap on the n900 is also on flash, albeit internal flash.

Actually that is an interesting point - by disabling the internal swap and moving it to the cheaply replaceable microSD, would you be extending the life of your N900?
(This is effectively what I have done, as it only uses the internal swap when the external one is full)

Last edited by elipsoid; 2010-10-17 at 12:37.
 

The Following User Says Thank You to elipsoid For This Useful Post:
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#78
I've tried elipsoid's method of setting the MicroSD's swap file priority higher than the internal flash and it definitely is faster. Also it's better to wear out a replaceable microSD than the non-replaceable internal flash storage.

You can also add those swapoff/swapon commands to a startup script, I've done it and it doesn't seem to affect boot time at all.
__________________
"Impossible is not in the Maemo vocabulary" - Caballero
 
Posts: 32 | Thanked: 24 times | Joined on Sep 2010
#79
I've personally not added my tuning and overclocking stuff to any startup script for fear of an endless reboot nightmare - that is just a personal thing, I know most people have no problems( I run a script from terminal -feels far more geeky )

Im not sure that these swapon / swapoffs would be fine at startup, as if the microSD is not functional it will return an error at the first step and preserve the onboard swap.

The second step disables the onboard swap though; and I have no idea what would happen if the device has no swap available before it re-enables it in the third step. I do know that the swap is either not used or used very little at all directly after a reebot (hence no difference to startup times as there is very little to copy, takes lot longer if the device has been in use for a while) so it may not matter.

I may have a look at my scrpits and have it check that the card is available before continuing, I'll post back here if I do.
 
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#80
Edit the file "/etc/event.d/rcS-late"

seeks the following:
Code:
   sfdisk -l /dev/mmcblk0 | /bin/busybox awk \
        -v home_opts="$home_opts" -v fat_opts="$fat_opts" \
    -f /usr/lib/genfstab.awk > $tmp_fstab
add below:
Code:
   sfdisk -l /dev/mmcblk1 | /bin/busybox awk \
        -f /usr/lib/genfstab2.awk >> $tmp_fstab
should look like:
Code:
   fstab=/etc/fstab
    tmp_fstab=/tmp/fstab

    sfdisk -l /dev/mmcblk0 | /bin/busybox awk \
        -v home_opts="$home_opts" -v fat_opts="$fat_opts" \
    -f /usr/lib/genfstab.awk > $tmp_fstab

    sfdisk -l /dev/mmcblk1 | /bin/busybox awk \
        -f /usr/lib/genfstab2.awk >> $tmp_fstab

    cmp -s $tmp_fstab $fstab || cp $tmp_fstab $fstab
    rm -f $tmp_fstab
save changes and exit.

Now copy the file genfstab.awk:
Code:
cp /usr/lib/genfstab.awk / usr/lib/lib/genfstab2.awk
Edit "/usr/lib/genfstab2.awk" and leave it like this:
Code:
#!/usr/bin/awk

BEGIN {
    # states so that we don't end up having more than one
    # of home or MyDocs; we can have as many swaps as we find
    __home = 0
    __fat = 0
}

/^\/dev\/mmc/ { start=1 }
start == 1 && $6 == 82 {
    printf "%s none swap sw 0 0\n", $1
}
the rest delete it.

Now you can restart, each time you start to check that the microSD has a swap partition and if so will mount.

I'm seeing a more elegant and does not need extra partition or cards.

The manipulation of system files can leave the N900 unusable.
I take responsibility for the results.
I really worked.

Last edited by WhiteWolf; 2010-10-19 at 09:56.
 

The Following 2 Users Say Thank You to WhiteWolf For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 09:34.