• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Link2SD: A Tutorial. New and Updated Version


<strong> <a href="http://androidforums.com/optimus
May 13, 2011
Part #1: Preperation

Your phone must be rooted with a custom recovery to go any further.

The first thing that needs to be done is to Download Titanium Backup and Root Uninstaller. I purchased the pro versions/key of both but they are not necessary to accomplish this Tutorial.

Open up Root Uninstaller. Let it do it's thing. It backs up all apps to the SD card in their apk form.
When it's done, close it.

Open up Titanium Backup.
If you purchased the pro key, push the menu key and select "batch actions". Then select to run the "backup all user apps". When it's done, close it.


If you didn't purchase the pro key go to the "Schedules" tab. Select to run both options, one after the other. When done, close the app.


Double check and make sure there are now two folders on the SD card with their names on them.

Go to the recovery If you have not backed up your ROM, and do so. Then reboot system.
Transfer all data from the SD card to your computer as the next step will wipe all data from it. When done, put the SD card back in the phone, and boot into the recovery.

With all the different recovery's for the V the menus can be slightly different. Navigate to the "partition SD card" option.

Note #1: You can only use 20% of the actual space available on the sd card for the partition. The partition should be 1-2GB, with 1GB being optimal.
This means you need at least an 8GB micro SD card (20% of 4GB is only 800MB), with a 16GB micro SD card giving you the ability to create a 2GB partition.

Pick to make a partition size that matches Note #1. This will format the partition to ext.3 which is only used by a couple of the ICS ROMs developed for our phones. The Cold as Ice ROM ( S ROM with a patch for the V) and the Quatrimus ROM.

If your using the stock ROM or a Froyo ROM, then the partition needs to be formatted to FAT32.
If using a Gingerbread ROM, then the partition needs to be formatted to ext.4.
The other ICS ROMs made for the S need to be formatted to ext.4. This applies to the Paranoid Android ROM as well.

Note #2: The ZenGarden recovery will allow you to switch the format of the partition to ext.4 and back to ext3. It's in the "Convert Partition" option. This means you never have to take the sd card out of the phone if installing any ROMs other than the Froyo ROMs. Just make the partition and reformat if need be to ext4 with the above mentioned option.

Put SD card into computer.
If you are using a Windows OS on your computer, use Mini Tool Partition Wizard to change the format of the partition to match whatever type of ROM your using. Open up Mini Tool and right click on the SD cards ext.3 partition (you can tell by it's size as well) and select to delete partition. Right click on it again and select to create partition. You will see the option to format it. Select the format that's best for the ROM you have installed. Make sure you also select primary instead of logical from same window.
Select the blue "Apply" arrow.

Uploaded with ImageShack.us

Uploaded with ImageShack.us

How to Partition SD card with Mac Disk Utilities
(These instructions will be numbered to correspond to the screen shots)

1) Open Applications, then open Disk Utility app.

2) In the app, on the left, select your SD card. Then select Partition from the five choices (the buttons running along the top of the big box on the right of the screen).

3) Follow instructions on the screen. Under
Part #2: Initial Setup and Use.

Download Link2SD and open it up.
A pop up window will appear. Select the format of the SD card partition. When the mount script has been created, close the app and reboot phone.

Open up app.
For those system apps your positive are safe to remove, long press the app and select that option.
For a complete list of whats safe to delete go to: All Things Root Guide/Guides/ APK's: Their purpose and, safe or not to remove (Big).


To link all downloaded apps, but widget apps, the PlayStore, and Link2SD, long press or tap the app. Select to create link. Check all boxes (if no library files- don't check).
When done linking all apps push the menu button and check the Auto Link box. Link2SD will now auto link all other apps as their downloaded and installed.





If a fresh ROM install, open up Titanium Backup and select the "Backup Restore" tab.
Install all widget apps and Root Uninstaller.


When done close app and open up Link2SD. Push menu button, then check the Auto Link box. Close app and open up Titanium Backup.
Select the "Backup and Restore" tab and restore the rest of your apps (and app data if needed). Link2SD will now auto link the apps as they are installed.

If you purchased the pro key then after installing your widget apps and Root Uninstaller, Go to Link2SD and check the auto link box. Then go back to Titanium backup, open it up, and push the menu button and select the "batch actions" option.
Select to run just the "Restore all missing apps and data" option.
Put the phone down and find something to do for five to ten minutes.

Note #1:If you have an app that hangs on install, reboot phone and install using Root Uninstaller. Go to the folder on the SD card and copy the apk. Then paste onto the root of the SD card and install (the pro version allows you to do this from the app). Then go back to Titanium and finish (Root Uninstaller does not backup app data).



Open up Link2SD and double check that all apps are linked to SD card and delete those system apps that you know are safe to uninstall.

Note #2: You can now select the view options and select to show only user apps.


Note #3: Root Uninstaller is also useful if you get an update to an app, but it's borked. Just delete the app and re-install the old apk that Root Uninstaller saved to the SD card.

The end result: I have 102 downloaded and installed apps, with 133.11MB of internal storage space still left over.
Another plus is my apps open up a whole lot quicker.
Upvote 0
What a great tutorial, andy!

I wanted to say that for the odd and rare mac users like me, you can do a partition on your sd card using disk utility on the mac. That's how I made my fat32 partition when I first did Link2sd. Don't remember the details, sorry, but I'm sure techno comfy people will figure it out if I could, lol! :)

Link2sd is awesome, guides like this are very helpful. I just scanned it quickly...would this be applicable to anyone flashing a new rom or updating rom as well?

Edit: Mac will only do a FAT32 partition, so it works for froyo but not other roms...
Upvote 0
Flashing a new ROM (so far).

I need to look at benslgdroid's tutorial on how to use Link2SD after an update to a ROM and see if all info is appropriate for newest Link2SD version. If it is I'm leaving it alone and keeping it in the ATR guide.

Question: Could you give me all info needed (and screen shots) for changing the format of the SD card using the Mac utility you described?
I'll post info in tutorial with your efforts mentioned and thanked.

I need to find someone to do the same with Windows OS and Mini Tool Partitioning Wizard as my Windows boot sector is borked and just have my Linux partitions.

Note: The MiRaGe ROM is now the fastest, smoothest, most stable and secure ROM for the V. It's like night and day compared to the Harmonia ROM, and with the ZenGarden recovery you never need to take the SD card out of phone at all. It will allow you to even reformat to ext.4 or to ext.3 if needed.

If you ever decide to move up to the best ROM for our little work horse, let me know. It's all now super easy and simple.
You already have a partition made so you won't even need to transfer data to computer during reformatting of SD card to ext.4 (although it wouldn't hurt, just to be on the safe side).

Nice hearing from you
Upvote 0
Wow, mirage sounds impressive. I don't have the time or mental bandwidth now, but if that day comes, I'll let you know!

Embarrassingly, i don't know how to do screen shots etc with my computer, I'm pretty lame. If i can figure it out, I'll get in touch. Would love to be more help, if i get a spare hour I'll try to figure it out.

I wasn't aware that Link2sd changed, my version is updated, i think, but i haven't flashed a new rom in a while. Ben's tutorial always worked for me, I'll keep checking back occasionally to see if the process has changed.

Thanks again!
  • Like
Reactions: AndyOpie150
Upvote 0
This is really a great write up Andy, very easy to follow. (Noob friendly) !

Although i won't have the need for it, since flashing the MiRaGe rom. I have all my apps setup and did a nandroid backup, i still have 156mb left ,that should do me for awhile.

But it's nice to know if i ever get the dreaded" low on storage space warning " i can come to this tut and get er fixed right up!

This MiRaGe rom is much more than i expected , i'm glad you kept giving it props in alot of your posts or i might not have flashed it cause i was so attached to backside.

Thanks for all your hard work and the other devs for keeping this little tank of a phone alive! :D
  • Like
Reactions: AndyOpie150
Upvote 0
AndyOpie150 said: 'If your using ... a Froyo ROM, then the partition needs
to be formatted to FAT32.'

The reason link2sd does not work when using harmonia 1.9 froyo and an ext
fileystem is that link2sd does not create the mount script correctly. But
it works if we create the mount script manually.

If you want to use ext4 with harmonia 1.9 froyo, install link2sd like this:

Install link2sd. There are many ways to install an app. It does not matter
which installation method you use. I already had Link2SD.apk on my sd card,
so I did 'pm install /sdcard/Link2SD.apk' in my adb shell. Do not run
link2sd yet.

Create a file /system/etc/init.d/11link2sd. There are many ways to create a
file. I enabled usb storage, mounted the phone's sd card as a drive on my
linux computer, created the file using a linux text editor, then moved the
file from the sd card to the system partition. Don't create the file
with a windows text editor, or you will get DOS line endings instead of unix
line endings.

The file should be like this:

insmod /system/lib/modules/mbcache.ko
insmod /system/lib/modules/jbd2.ko
insmod /system/lib/modules/ext4.ko
test -d /data/sdext2 || mkdir /data/sdext2
mount -t ext4 -o rw /dev/block/mmcblk0p2 /data/sdext2

Move the file from the sd card to the system partitions by running the
following commands. Use adb or a terminal. You need to be root to do

# mount -t yaffs2 -o remount,rw /dev/block/mtdblock5 /system
# cp /sdcard/11link2sd /system/etc/init.d/11link2sd
# chown root.root /system/etc/init.d/11link2sd
# chmod 0755 /system/etc/init.d/11link2sd
# mount -t yaffs2 -o remount,ro /dev/block/mtdblock5 /system

Reboot the phone. After the phone reboots, you can run link2sd normally.

This works with VM670NH_recovery.img, harmonia 1.9 froyo, link2sd 1.9.3.

Some additional comments:

If you configure link2sd to automatically move new apps, but new apps
install to /data instead of the sd card, go into the link2sd settings and
change destination from automatic to external.

You can create /system/etc/init.d/11link2sd before installing link2sd. It
does not matter which you do first.

You can skip the second mount command because that will happen automatically
when you reboot the phone.

The chown command can probably be skipped because you are probably already

In the file, you can use /dev/block/vold/179:2 instead of /dev/block/mmcblk0p2
This is assuming you want link2sd to move apps to the second partition of
the sd card. If you want link2sd to use a different partition, you will need
to change these.

If you use a text editor app, run the first mount command, then create the
file in its final location, then run the chown and chmod commands.

If you use a windows text editor, you can convert the file from DOS text to
unix text with:

cat /sdcard/11link2sd | tr -d '\r' > /system/etc/init.d/11link2sd

If you run clockworkmod recovery, and if you used clockworkmod recovery to
mount /system, /system will be mounted readwrite. So you can skip the mount
commands if you create the file from clockworkmod recovery.

The first time I tried to install link2sd, I got the following error

Mount script error
Mount script cannot be created
mount: No such device
ext2 may not be supported on yur device. Try FAT32 on the second partition.

I did a google search, and found this problem occurred on many different
phones using froyo ROMs, and most people gave up and used fat32 filesystem
instead of an ext filesystem.

From my previous experience with linux, I guessed that the ext modules were
not loading, probably because they require other modules to load first.
So I tried loading every module in /system/lib/modules, and if some failed
to load, I tried other modules, then tried the problem modules again.
Eventually I loaded every module except wireless.ko. Then I checked
/proc/modules, which said:

ext4 199871 0 - Live 0xbf0dc000
ext3 103300 0 - Live 0xbf0b7000
ext2 54179 0 - Live 0xbf0a1000
jbd2 48294 1 ext4, Live 0xbf08d000
jbd 42091 1 ext3, Live 0xbf07a000
librasdioif 3210 0 - Live 0xbf073000
mbcache 5272 3 ext4,ext3,ext2, Live 0xbf06c000
tun 10479 0 - Live 0xbf063000

This shows that ext4 requires jbd2 and mbcache; ext3 requires jbd and
mbcache; ext2 requires mbcache.

Once I knew which modules were required by ext4, I modified a sample link2sd
mount script and made it load the correct modules in the correct order, and
then link2sd works.

I have VM670NH_recovery.img and harmonia 1.9 froyo. These have mkfs.ext2 and
fsck.ext2, but no mkfs or fsck for ext3 or ext4.

When I uninstalled link2sd, link2sd did not remove the mount script.
  • Like
Reactions: AndyOpie150
Upvote 0
Thanks kmh63459.
Super Good info.
Intermediate and advanced user will enjoy this very much.
I'm going to give your info a try myself.

Edit: After making sure my Linux build environment is set up and configured properly. 50 year old brain is tired. It's not doing bad considering I purchased my first computer 3 years ago and my first Android device 2 years ago (the LG Optimus V).
Upvote 0
Some people on the internet suggested hooking debuggerd and bind mounting
sdcard directories over the data directories. Some people think this is
better than using link2sd because apps are installed directly to the sdcard
instead of being first installed to the data partition then moved to the

I tried this on my optimus V running VM670NH_recovery.img and harmonia 1.9
froyo. It does not work.

I renamed /system/bin/debuggerd to /system/bin/debuggerd.bin. I created a
shell script named /system/bin/debuggerd like this:


test -e /sdcardp2 && exec /system/bin/debuggerd.bin

mount -o remount,rw -t rootfs rootfs /
mkdir /sdcardp2
mount -o remount,ro -t rootfs rootfs /

insmod /system/lib/modules/mbcache.ko
insmod /system/lib/modules/jbd2.ko
insmod /system/lib/modules/ext4.ko
mount -t ext4 -o rw /dev/block/mmcblk0p2 /sdcardp2

test -d /sdcardp2/data.app || mkdir /sdcardp2/data.app
chmod 0771 /sdcardp2/data.app
chown system.system /sdcardp2/data.app
cd /data/app
for f in * ; do
test -e $f || continue
test -e /sdcardp2/data.app/$f || cp -a $f /sdcardp2/data.app/$f
#rm -r $f
cd /
mount -o bind /sdcardp2/data.app /data/app

test -d /sdcardp2/data.dalvik-cache || mkdir /sdcardp2/data.dalvik-cache
chmod 0771 /sdcardp2/data.dalvik-cache
chown system.system /sdcardp2/data.dalvik-cache
cd /data/dalvik-cache
for f in * ; do
test -e $f || continue
test -e /sdcardp2/data.dalvik-cache/$f || cp -a $f /sdcardp2/data.dalvik-cac
#rm -r $f
cd /
mount -o bind /sdcardp2/data.dalvik-cache /data/dalvik-cache

test -d /sdcardp2/data.data || mkdir /sdcardp2/data.data
chmod 0771 /sdcardp2/data.data
chown system.system /sdcardp2/data.data
cd /data/data
for f in * ; do
test -e $f || continue
test -e /sdcardp2/data.data/$f || cp -a $f /sdcardp2/data.data/$f
#rm -r $f
cd /
mount -o bind /sdcardp2/data.data /data/data

exec /system/bin/debuggerd.bin

It seemed to work at first. I installed some apps, and the apps installed to
the second partition of the sdcard and ran. But after a while the second
partition of the sdcard became corrupted.

I tried using ext3, ext2, and vfat instead of ext4 for the second partition
of the sdcard, but this did not help.

The filesystem corruption seemed to occur when installing certain apps. So
maybe the problem was with the apps, and this would work as long as you only
use good apps. But android is supposed to prevent bad apps from trashing
the filesystem.

Maybe the bind mounting functions of the kernel are buggy, and this would
work with a better kernel. But bind mounting works in linux, and the
android kernel and mount program are based on linux, so bind mounting should
work in android.
Upvote 0
I thought at first I had messed this up. When I got to the point of "Part #2: Initial Setup and Use."...Link2SD said, "second partition not found". My phone wasn't recognizing that my SD card had been remounted at all. ACK!!! Freaking the hell out at this point!

Using Mini Tool is where I messed up. I was not at all familiar with how to use it. I failed to click "apply" after I deleted the partition in order to recreate it from ext3 to ext4. It did still let me change it to ext4, I clicked "apply" after that, reloaded all my info onto the sd, mounted, nothing.

So, I decided to start over. Erased SD card under settings>storage, rebooted into recovery, then recreated the partition (I made it 2gb, as my SD is 16gb and it only gave the options of 1 or 2gb, not 1.5)

*Something worth mentioning - I used clockwork recovery to do this, and after choosing what size partition to create, the next screen asks you to choose what swap size to use. I didn't see that coming. I chose 0.*

I go back into Mini Tool. I deleted the partition, clicked apply, right clicked on it again, recreated as ext4, apply. Reloaded computer backup onto SD, remounted, still nothing. At my wits end, I did some searching. That's when I learned...

*Another thing worth mentioning* - In Mini Tool, it shows FAT32 as "primary" and it seems that the default setting for the ext4 partition is "logical"...you have to right click on it, and change it to primary also, being sure to click apply after.

Remounted SD again, and instantly the phone picked it up! Finally!!

I was able to proceed with creating the mount script as directed above, then it prompted me to reboot.

I was able to finish as per the tutorial!

Question. So, now that I'm this far - all the apps that were previously on my sd card, are they actually still on the sd, or are they in the internal or what? What I mean is, when I go to the stock app manager, go to the sd card tab, it lists all my apps, but none have a check beside them anymore. So I'm still kind of confused about what I've just done. I'm assuming that they're technically still on sd, but my phone thinks they're in internal. Link2SD currently shows 86.67mb free. Do the apps need to stay as is, or do they need physically moved to the SD then linked or what?
Upvote 0
If you didn't save everything on the sd card to a folder on your computer before partitioning the sd card, then they are not there.
Did you use Root Uninstaller and Titanium Backup?
That info needed to be put on the computer.
Once done with the partitioning then your supposed to move everything back to the sd card. If you did that, then their still on the sd card.

Sorry for lack of info on Mini Tool (I personally used Gparted in a linux distro). I'll include that in the tutorial.
You don't need a swap partition.
I'll change the partition size info as well. Not all recovery's offer the 1.5GB option anymore.
  • Like
Reactions: PoisonIvy
Upvote 0
Yeah, I did RU & TB, then saved to a folder on the computer first. It was late & I'd had too much coffee and not enough sleep :p I guess I'm just so used to knowing for sure which location the apps actually were at. Seeing them in the stock app manager as being all on internal I guess threw me off kilter. I was only able to get to 86mb free (which is an improvement) on internal with all the apps I had, how are you getting so much free space on the same phone? For example, I had previously uninstalled Angry Birds once because it was so large, well I reinstalled it & it stole a huge chunk of what I had freed. What should the default setting be for install location on Link2SD?
Upvote 0
It varies with the app. Apps that control the system and widget apps, need to be on the internal storage. All others is just a move and see game. Most should be able to be moved to the ext.4 partition. If an app acts up on the partition, move it to the internal storage.
Note: Just pick automatic in the install location setting. If an app gets moved to the FAT32 partition then just manually create a link.
  • Like
Reactions: PoisonIvy
Upvote 0
Well, I ended up having to backtrack and fix some things. After I had the whole process done, I got to meddling around and messed some things up. Totally my own fault. :stupido2:

I found a good FAQ for Link2SD that helped me wrap my brain around what this process does & how it does it. It's now better than it was before! I have all the apps I had to start with linked (save for a few*), and even reinstalled Angry Birds again, and this time it didn't eat a huge chunk of my free internal space! Still have 91mb free AND everything works great! :D

*The only things not linked are google play services, play store, google search, link2sd, root browser & superuser. I know you can't link the play store, but what about any of the others? I used to keep google play services on SD before I made this change without any problems, would that be ok? I wasn't sure if it was kosher to link titanium & root uninstaller, but I gave it a shot and it didn't seem to bork them. Any other tips you might have for maximizing the free internal space would be most helpful!

And a great big, major THANK YOU! For the tutorial, and all your help & advice!!! This is a major leap to getting more out out of my phone than just having root, going from stock froyo to gb & being able to move unmoveable apps & deleting the bloatware.
Upvote 0
The Google Play Services can be linked. I wouldn't link Link2SD or Superuser. Root Browser, Titanium, Root Uninstaller, Gmail, Google Maps can all be linked.

Try Android System Info and Fast Reboot (closes all apps and only opens those that need to be), the safest way to gain back RAM which is most important.
  • Like
Reactions: PoisonIvy
Upvote 0
Hey Andy,
Link2SD has started going wonky on me. I thought maybe I had everything fixed when I started the thread about it...but no. It's not linking jack anymore. I'm getting this message:

cannot create /data/sdext2/dalvik-cache/data@app@com.facebook.
katana-1.apk@classes.dex: error 22

WTH is going on? I was loving L2SD, everything was going great until I started trying to update some things. Even if I try to install a brand new app, I get this message.
Upvote 0
I'm running CM7, the partition was formatted to ext 4. Everything was going great with L2SD, even with updating current apps, until last night. I got a notification that Titanium had an update, and after it was done installing, I got a L2SD failure notification. My free internal space decreased a bit. Then I tried to download a new app, just to see what would happen...failure to link, more internal space gone. I *thought* I had everything fixed but no. I started losing apps & free internal space. Being off from work today, I decided to just uninstall *everything*, and start from scratch. I'm in the process of reinstalling everything now, and it's all going well. I have no clue what happened.
Upvote 0
I'm real hip about keeping my cache clean...I had to learn to be back before I got L2SD, and free internal space was an issue, even with every app I had on SD. I'm not familiar with what data tombstones are, but I did see a "tombstone" folder while prowling around in Root Browser while this was going on (it was empty). I'm going to get that SD Maid Pro and see what it's like. So far so good with this re-do, L2SD linked everything I re-installed just like it should with no bumps in the road! :D
  • Like
Reactions: AndyOpie150
Upvote 0
Sorry for the dumb question, but my memory is getting hazy, lol... When we flash a new ROM do we need to wipe the sd partition we use for the links?

I'm seriously wanting to upgrade to mirage or harmonia 2. I would need an ext partition for those, correct? Mine is currently fat for my froyo harmonia.

When I flash and go to set up with TiBu and L2SD, can I create the new ext. partition through L2SD, or do I need to create the partition on my computer like I originally did when first setting up L2SD?

Upvote 0
All good questions.
If moving up to a Gingerbread ROM the first thing you will need to do is upgrade your recovery.
Then on your computer you will need to change the format of the partition to ext.4. Usually selecting to delete, then selecting to create (should get option to select format when you select to create, as well as the option to select it as a logic or primary), making sure it's a primary partition as well. Then select to apply the changes.
Not sure how you need to do this on your MAC though.

In the recovery select all the wipe options once. Go to the advanced option and select to wipe the dalvik cache.
Go to the install options and pick to install obijohn's wiper ( this will wipe everything one more time, plus wipe the sd ext.4 partition).
Now you can install the ROM (If using Leslie Ann's ROM you don't need the Gapps) and the 20110828 Gapps if installing a Gingerbread ROM.

Note: The MiRaGe is still the best and most stable ROM for our V.
I think you will really like the ClockworkMod touchscreen recovery. I made a flashable zip of it so you can install from your current recovery.
It can be found here:

To install, install like it was a new ROM ( you do not need to wipe anything).
Go back to main recovery menu. Go to the advanced section and select to reboot the recovery. It will now boot into the ClockworkMod touchscreen recovery.
This is a whole lot faster and easier than typing in all that code into a terminal.

Once you have the new ROM rebooted a couple of times to tighten it up, then install Link2SD. Open it up and select the ext.4 format. Let it create the mount script then reboot the phone.
No you can follow the rest of this guide.

Edit: Fixed link.
Thanks badblue1
Upvote 0
The recovery you have is just fine. The Touchscreen ClockworkMod recovery gives you the added option of being able to use soft keys on recovery display.

Once you delete the FAT32 and create the ext.4 partition, transfer all your data back to SD card. Make sure you put the new ROM.zip (and the Gapps.zip if needed) onto the SD card, then put SD card back into phone.
Go to recovery screen
Then Wipe everything including the dalvik cache (advanced section). If you have obijohn's wiper.zip use it next, if not, go to mounts and storage section and format the boot, system, data, cache, and sd ext (don't wipe the sd card).
Now install ROM (and gapps if needed).
  • Like
Reactions: sushifor5
Upvote 0


We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.