![]() |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
I created a swapfile but when I went to do swapon it seems like it only works with devices. If I were to mount the swapfile manually in fstab would it work? I wanted to ask TMO so I didn't brick my system. Thanks. BTW, what is Busybox? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
How about using the built in 32GB as virtual ram, and using the micro SD as whatever?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
So I figured out how to do the swapfile but when I change fstab it just writes over it when I reboot. Is there another file I can use so that it mounts on startup? I'd like to avoid init scripts if possible. Thanks.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
/etc/event.d/rcS-late On line 15, it calls sfdisk to dump the partition data, and passes it through: /usr/lib/genfstab.awk I modified /usr/lib/genfstab.awk to make my changes permanent, but this is an ugly hack. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Im afraid of some flash characters - like write/read cycle limit.
Crazy idea - change onboard ram chip to some 512MB ? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Please guide me how can I change these folder:
space for software installations etc__| /home____________| 2GiB__| Partition of 32GB memory chip Nokia N900_____________________| /home/user/MyDocs_| 27GiB_| Partition of 32GB memory chip to microSD card? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Okay I seem to have managed to format SD from n900's terminal using bundled sfdisk. Here's a step-by-step instruction that's actually not as easy as I wanted it to be:
1) Backup all valuable data from your SD 2) sfdisk /dev/mmcblk1 3) Calculate sizes of partitions you want to create using info on cylinder size. Assume you want fat partition to be X cylinders long. The program asks for parameters describing partitions you want to create (4 of them) 4) ,X(number you calculated),0b First parameter is omitted, then sfdisk will start with first available block, Second parameter is actual number you got when calculating 1st partition size. 3rd parameter is Fat32-noLBA partition table ID. Then input parameters for the second partition parameters 5) ,,S First and second parameters are omitted - all available space will be used. Partition ID "S" = linux SWAP. 6) Press enter twice (2 dummy partitions are created) 7) If you've read confirmation output for all the partitions to be created and think it's correct then go ahead and type "y" to apply the changes. If not - use "n" to repeat parameter input or "q" to quit sfdisk without making any changes. Actual commands I used for my 8gig microSD: sfdisk /dev/mmcblk1 ,232000,0b ,,S This resulted in my card having 350 megs swap partition in addition to a fat32 partition. I then formatted fat partition from my W7 desktop, and used mkswap & swapon to leverage swap partition. Sorry for ESL and I'm underslept today to make things even worse. Please note I'm neither maemo, linux, BusyBox or sfdisk expert, so it would be great to recieve some comments on this tutorial from gurus and then publish it to the wiki with appropriate changes. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I have tried two class 4 microSDHC cards as second swap devices on N900
a) Polaroid (PNY) 8 GB Class 4 b) Kingston 4 GB Class4 The Kingston one provided much better performance with a 768MB partition on it as a swap device. I am now planning to get a Transcend Class 6 microSHDC card (this card has rave reviews about it's high write throughput) and use it as additional swap space. IMHO 256MB RAM just doesn't cut it for the N900 loaded with applications many of which run in the background. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
Errm?? Do you not realise that if you remove the backcover, the memory card is ejected? Once that little magnet on the backcover isnt closing the switch then the memorycard is dismounted and unable to be accessed by the device. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I have a Transcend class 6 and I've added a swap partition on it now. I'm not thoroughly impressed yet.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
guys, i would like to try this. has anyone seen any BIG improvements so far?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
what objective benchmarks could be used to compare the different cards? should the main swap file be turned off in favor of the microsd swap?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
The speed boost for me has been quite small, but I'd say it's a worthwhile mod if you have the extra space.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
i did this mod and made swap off for emmc and on for microsd... with emmc swap i could apps opening slowly after 5 apps but with swap on microsd it was pretty smooth...
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
omg this is best invention since fried rice, I mean cmon the swap memory is slow so no problem add more 2gb ram =sex
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
it says invalid arguement |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
If creating an extra swap on the MicroSD does make a noticeable difference, can someone actually make a simple app with a GUI to make this happen without needing to type all the commands? (like partitioning the microsd, setting the swap etc) Would be pretty cool. I'm no dev unfortunately. =P
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
where there are 3 options Battery Saver=Titans hunger clock setting 0-600 mhz with 1gb ram Moderate=Titants 500-800mhz with howmuch swap on the sd you got Extreme=500-1ghz and how much swap you got |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Hi!
Was wondering about my N900 often being very slow and unresponsive (and trying to make up some easy explanation to my wife how can it it take 2-3 minutes to silent the alarm of my new state-of-the-art mobile computer-phone-thingy when it happens to ring half an hour too early). Noticed that is because of IO waits caused by swapping. Sure I got dozens of apps but hey isn't that what this device has been built for. Wondering how to improve it so bumped at this thread going straight into the point. There were already step-by-step instructions for creating those partitions but as I happened to be MUCH more comfortable with fdisk than sfdisk and there was fdisk installed with the Easy Debian package, did the tricks with that. Also, other parts of that process were scattered all around this thread and the internet so decided to do some wrap-up. So, here's how to: - Back-up whatever needed from the card, it WILL be empty after this procedure. - Close anything that might use the uSD card - Run Debian chroot (install Easy Debian if you don't have it already) - On the console: --- umount /media/mmc1 fdisk /dev/mmcblk1 p #print partition list, check it's the correct device, see how many cylinders you got and how many bytes per cylinder. d #delete partition <enter> #partition number, default=1 n #new partition p #primary <enter> #start cylinder, default=1 1900 #end cylinder, my 16GB card has 1949 cyls and 49 happened to be pretty close to 384MB which should be fine so 1900 can be used for the data partition n #new partition p #primary <enter> #start cylinder, default=first non-allocated <enter> #end cylinder, end of device = allocate the rest for swap t #change partition type 1 #partition number b #vfat t #change partition type 1 #partition number 82 #Linux swap p #print table, check everything is OK w #write table <open back cover> #Re-seat the card to make kernel forget the old parameters <remove card> <insert card> <re-insert back cover> mkswap /dev/mmcblk1p2 #prepare the swap partition swapon /dev/mmcblk1p2 #enable the swap partition free #check that you now have more swap mkfs.vfat -F 32 /dev/mmcblk1p1 #format main partition mount /media/mmc1 --- Now test copying something into your uSD card to see it works properly. The swap partition won't be automatically taken in use after reboot, use a startup script like this one to make it automatically. Did this only today so don't have much experience yet but so far feels more like a new device than a mere performance improvement! Trying to abuse it to make IO waits hit the roof but no, can't get them over 30% so haven't managed to make it unresponsive. I'd guess it'll be worse after a couple of days uptime but looks promising anyway. My card is a Nokia 16GB class 2 card so shouldn't be that fast but measured with hdparm -tT ("apt-get install hdparm" with Debian chroot) to be actually a bit faster than a no-name class 6 8GB card. Hdparm gives about 15MB/s non-cached read speeds for this 16GB card and about 20 MB/s for the internal /dev/mmcblk0p3 swap so the card is clearly slower but still helps a lot. Great thanks guys for the groundwork so far! |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I installed gparted in easy debian & used it to easily resize and repartition my SD card directly on my N900. What other phone can do that?? :)
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
tracker-process -t |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I have a 16GB memory Card. How do I use it as additional ram for N900?
If I want to use only 1GB, 2GB or 4GB as additional ram & remaining functions of the memory card, how do I do it? Is there any noticeable difference in the performance after using MicroSD space as ram? Please help. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
You're not really using the microSD space as RAM, you're using it as swap space. You can partition as much or as little space as you want. The performance improvement isn't huge, it's just a little faster.
http://wiki.maemo.org/Swap_on_microS...d_for_swapping |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
Still started to get unresponsive after a couple of days so checked what's going on. Seems that the new partition will by default have lower priority than the internal one so it would be used only after the internal swap is exhausted, no added performance. The default BusyBox swapon doesn't even support setting the priority so would need to set the swap partition in the fstab (either somehow commanding how it's generated or editing between generating and taking in use), or using a proper swapon command. Luckily Easy Debian happens to have a proper swapon which makes testing easier and pretty risk-free: (Run Debian chroot) [root@deb-m5v3d: ~]swapoff /dev/mmcblk1p2 # Turn off uSD swap [root@deb-m5v3d: ~]swapon -p 0 /dev/mmcblk1p2 # Turn on uSD swap with priority 0 [root@deb-m5v3d: ~]swapoff /dev/mmcblk0p3 # Turn off internal swap (might take some time as it'll need to copy stuff to the other swap partition) [root@deb-m5v3d: ~]swapon -p 0 /dev/mmcblk0p3 # Turn on internal swap with priority 0 [root@deb-m5v3d: ~]swapon -s # Check the status Filename Type Size Used Priority /dev/mmcblk0p3 partition 786424 236 0 /dev/mmcblk1p2 partition 393584 120276 0 There we go, both swap partitions used. Let's try a fresh start and then opening some apps and web pages (/proc/swaps can be used both native and with Easy Debian): Nokia-N900:~# cat /proc/swaps Filename Type Size Used Priority /.debian/dev/mmcblk0p3 partition 786424 87728 0 /.debian/dev/mmcblk1p2 partition 393584 89360 0 Looks nicely balanced between the partitions. And how's swap space activity by Easy Debian iostat: avg-cpu: %user %nice %system %iowait %steal %idle 32.49 3.54 25.29 18.61 0.00 20.07 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn mmcblk1 136.89 3026.79 1179.79 182152 71000 mmcblk1p1 0.00 0.00 0.00 0 0 mmcblk1p2 136.89 3026.79 1179.79 182152 71000 hdq10 169.18 340.81 0.86 20510 52 hdq4 0.00 0.00 0.00 0 0 hdq2 0.00 0.00 0.00 0 0 mmcblk0 203.95 4405.68 1212.75 265134 72983 mmcblk0p1 0.90 63.91 0.12 3846 7 mmcblk0p2 57.86 1278.70 34.56 76952 2080 mmcblk0p3 145.20 3063.08 1178.07 184336 70896 Lot's of swap activity but perfectly balanced and only 18.61% I/O waits, looks good. Let's see how will it look like after some days uptime now. Anyone know if fstab generation could be configured somehow? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Hmm interesting. I wonder if there's a way to set swap files with equal priority without using Easy Debian's swapon. It would be nice to be able to do this in a startup script that you won't have to worry about it breaking if Easy Debian is removed / gets messed up somehow. Plus mounting the chroot during startup and copying swap content back and forth would bog things down quite a bit.
Me might need someone to port the GNU swapon/swapoff tools to Maemo 5... |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
:( what to do? I have a 4gb card! |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
No inputs frm anybdy?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
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!! |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
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 |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
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. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
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??? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
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:cool: Simply this: Code:
Code:
cat /proc/swaps |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
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. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
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) |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
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. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
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. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Edit the file "/etc/event.d/rcS-late"
seeks the following: Code:
sfdisk -l /dev/mmcblk0 | /bin/busybox awk \ Code:
sfdisk -l /dev/mmcblk1 | /bin/busybox awk \ Code:
fstab=/etc/fstab Now copy the file genfstab.awk: Code:
cp /usr/lib/genfstab.awk / usr/lib/lib/genfstab2.awk Code:
#!/usr/bin/awk 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. |
All times are GMT. The time now is 08:13. |
vBulletin® Version 3.8.8