Hi everyone. It’s been long time since I wrote my last post, but I’m a bit busy with some projects (among them…mhmm…how it’s called…oh, yes, life), so sorry if you missed me.

I decided to post about a pretty intriguing mod for the N9 I found some time ago on EverythingN9. Yeah, there’s already a guide and a thread on TMO, but I would like to write it down since with CODeRUS’ Aegis-hack and OpenSudo some step may be changed – and, you know, I consider this miserable blog as my scrapbook, so no offense on this, I’m not afraid to give credits and I don’t want to appropriate others’ hard work.

I will not bother you trying to explain what a Swap file is, if you are here you already know what you’re looking for. So, let’s start.



I’ll try to be as concise as possible, since anyone hardly read a disclaimer: DO IT IF YOU KNOW WHAT YOU’RE DOING. Read the whole guide before you start and if you have no clue of what you’re going to do, please don’t go further or don’t blame on me if something gets wrong and you have to re-flash your N9.

Before you start

1. First of all, be sure you’ve already installed Developer Mode on your N9, you will need Terminal and the SDK Connectivity Tool. Then install, rather via N9QTweak, the Aegis hack, which should itself install OpenSudo. Choose a password for OpenSudo (using rootme could be a good idea) and close N9QTweak.

2. Open the terminal and type:



passwd user

I tip you to use rootme once again.

3. If it’s not already installed, install nano text editor by typing:

# apt-get install nano

Now you can close the terminal.

SSH connection

4. Open the SDK Connectivity Tool, under WLAN you’ll find your IP address. Take note of it.

5. If you run Windows, you can use Putty, it doesn’t require installation. If you run Linux, just open the terminal and type:

ssh user@IPaddress

Use the password you chose on the step 2.

6. From the SSH session, type:



sudo -s

(OpenSudo password, see step 1)

accli -I |grep tcb-sign

This last line MUST return:


If not, don’t go further.

The crucial part

7. Type:

cp /etc/init/enable-swap.conf /tmp/enable-swap.conf

nano /tmp/enable-swap.conf

8. Nano will open. Locate this line:

if [ $ramsize -gt 1000000 ]; then

and replace the first 0 with a 1 so it becomes:

if [ $ramsize -gt 1100000 ]; then

Then locate this line:

swappart=`sed -n -e '/swap/s/mtd\([0-9]\).*/\1/p' /proc/mtd` || true

and replace swap with var so it becomes:

swappart=`sed -n -e '/var/s/mtd\([0-9]\).*/\1/p' /proc/mtd` || true

Press and hold Ctrl + X and save, ensuring the new filename will overwrite the old one.

9. Now type:

cp /tmp/enable-swap.conf /etc/init/enable-swap.conf

export A=`sha1sum /tmp/enable-swap.conf |cut -b1-40`;

perl -pi -w -e 's#40 (.*) A(.*)enable-swap#40 $ENV{A} A$2enable-swap#smg' /var/lib/aegis/refhashlist

accli -c tcb-sign -F /var/lib/aegis/refhashlist -i /var/lib/aegis/refhashlist

/usr/sbin/validator-init; aegis-loader;echo 1 > /sys/kernel/security/validator/flush


10. The phone should now reboot itself. Keep your fingers crossed!


Before applying the mod, DropCache reports a Swap file size of 255mb. After, it should report 412mb. Practically, now the N9 should be able to keep more apps in background before it slow down.

I hope this has been useful to you. See you soon!

via [1], [2]

7 thoughts on “Increase Swap file size on your N9

    1. Honestly I’ve never noticed any remarkable performance decreasing. After this mod, the phone can manage better “hungry” apps and I think it’s been speeded up a little.

        1. My pleasure 🙂

          Yes, but I applied it via N9QTweaks. Are you referring to the bottom left corner in the Drive app? Does i no longer work for you after applying the patch?

    1. So try to uninstall the patch you’ve installed before, reboot and install it again via N9QTweaks. If neither it doesn’t work, you may need to reinstall Drive. isn’t any command such as apt-get install nokia-drive –reinstall available?

  1. I still use my N9 daily. I found this article in my bookmarks today, totally forget about it! I followed your instructions and I now have 411mb swap, thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s