Thread
:
Using Micro SD Card as Virtual Ram on Nokia N900?
View Single Post
x-rated
2010-09-02 , 12:38
Posts: 25 | Thanked: 59 times | Joined on Jun 2010 @ Finland
#
60
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!
Last edited by x-rated; 2010-09-07 at
10:10
. Reason: Had swap partition name wrong (thanks Tomast:)
Quote & Reply
|
The Following 4 Users Say Thank You to x-rated For This Useful Post:
abubakar
,
bunanson
,
cheve
,
epitaph
x-rated
View Public Profile
Send a private message to x-rated
Find all posts by x-rated