[APP] Link2SD perfect for XT720

Search This thread

grimouille

New member
Jan 13, 2011
1
0
Im not able to write the xt2 file in the lib directory. Seems like Its a read only directory.

Anyway I can correct that?

(Yes, I rooted my phone)
 

Riley600

Senior Member
Dec 29, 2010
199
40
Vancouver
Im not able to write the xt2 file in the lib directory. Seems like Its a read only directory.

Anyway I can correct that?

(Yes, I rooted my phone)
I'm not sure how you're doing it. If it's with Root Explorer you need to tap the Mount R/W at the top in order to write to that directory, I believe.

Works perfect I checked yesterday. Greetings from Guatemala. Sorry for the English but the Google translator xD. :D
Greetings from Canada :)
 

allahmar

Member
Jan 19, 2011
14
1
Im not able to write the xt2 file in the lib directory. Seems like Its a read only directory.

Anyway I can correct that?

(Yes, I rooted my phone)


it was the same error i got when i first tried root
you need to tap the Mount R/W at the top like what Riley600 said.

how can I confirm that links2sd is working? my memory says 80mb free is this normal? ive linked all my apps to sd.

next project froyo jit. thanks for the input Riley600
 

hardKNOXbz

Member
Jan 20, 2011
48
2
Belize City
I guess I'm too slow... lol
i formatted my card through Ubuntu and not Link2sd finally was able to mount my ext2 woohoo...

started to link, rebooted the phone, and tried to open apps, all forced closed.

ran a script through ADB and re-installed all apps, tried it again. same thing...

think i'm throwing in the towel on this one.
:(
 

kousik

Senior Member
Nov 28, 2010
235
44
Bangalore
I guess I'm too slow... lol
i formatted my card through Ubuntu and not Link2sd finally was able to mount my ext2 woohoo...
started to link, rebooted the phone, and tried to open apps, all forced closed.
ran a script through ADB and re-installed all apps, tried it again. same thing...

When you move things around the biggest problem seems to be the permission and ownership. Before giving up, just make sure they were in shape ...
 

kousik

Senior Member
Nov 28, 2010
235
44
Bangalore
I quickly tried to do by hand what the app is doing. Unfortunately it didn't work for me either. Here are the steps I followed, I wonder if anyone can identify where things went wrong.

  1. Fresh installed Angry Birds
  2. Mounted the ext2 partition of the SD card to /data/sdext2
  3. Copied /data/app/com.rovio.angrybirds.apk to /data/sdext2
  4. removed original, and created a symbolic link com.rovio.angrybirds.apk -> /data/sdext2/com.rovio.angrybirds.apk
  5. This removed Angry birds from my app list, but I thought that's Ok as long as there's adb
  6. In adb shell, tried to execute "am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.rovio.angrybirds/com.rovio.ka3d.App -f 0x10200000"
  7. No joy :-( it fails with Error: Activity class {com.rovio.angrybirds/com.rovio.ka3d.App} does not exist. If the file was physically present instead of symbolic link, this launches Angry birds

Trying to guess where did I go wrong. I am kind of sure that reboot is not required, because without rebooting I can copy the apk back and forth and launch the application. Anyway I don't have boot script modified that could mount the ext2 on boot. Wondering if that matters ...
 

hardKNOXbz

Member
Jan 20, 2011
48
2
Belize City
i think this is the same thing that is happening to me. this is the adb logcat when i've tried to run my linked twitter app.

Code:
W/asset   ( 8283): Asset path /data/app/com.twitter.android.apk is neither a directory nor file (type=0).
W/dalvikvm( 8283): threadid=3: thread exiting with uncaught exception (group=0x4001d1c8)
E/AndroidRuntime( 8283): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 8283): java.lang.RuntimeException: Unable to get provider com.twitter.android.provider.TwitterProvider: java.lang.C
lassNotFoundException: com.twitter.android.provider.TwitterProvider in loader dalvik.system.PathClassLoader@455a3f70
E/AndroidRuntime( 8283):        at android.app.ActivityThread.installProvider(ActivityThread.java:4271)
E/AndroidRuntime( 8283):        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4043)
E/AndroidRuntime( 8283):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4002)
E/AndroidRuntime( 8283):        at android.app.ActivityThread.access$2900(ActivityThread.java:119)
E/AndroidRuntime( 8283):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1902)
E/AndroidRuntime( 8283):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8283):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 8283):        at android.app.ActivityThread.main(ActivityThread.java:4364)
E/AndroidRuntime( 8283):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8283):        at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 8283):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 8283):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 8283):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 8283): Caused by: java.lang.ClassNotFoundException: com.twitter.android.provider.TwitterProvider in loader dalvik.s
ystem.PathClassLoader@455a3f70
E/AndroidRuntime( 8283):        at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime( 8283):        at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime( 8283):        at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime( 8283):        at android.app.ActivityThread.installProvider(ActivityThread.java:4256)
E/AndroidRuntime( 8283):        ... 12 more
W/ActivityManager( 1380): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 1380): Activity idle timeout for HistoryRecord{45726f48 com.twitter.android/.LoginActivity}

the below shows that my twitter app is symbolically linked.
Code:
# pwd
pwd
/data/app
# ls -l
ls -l
...snip...
lrwxrwxrwx root     root              2011-01-26 10:36 com.twitter.android.apk -> /data/sdext2/com.twitter.android.apk
...snip...

i've checked the sdext2 folder and the com.twitter.apk app does exists in there... so i don't know what's going on
 

kousik

Senior Member
Nov 28, 2010
235
44
Bangalore
i think this is the same thing that is happening to me. this is the adb logcat when i've tried to run my linked twitter app.
Code:
W/asset   ( 8283): Asset path /data/app/com.twitter.android.apk is neither a directory nor file (type=0).
i've checked the sdext2 folder and the com.twitter.apk app does exists in there... so i don't know what's going on

This nails it ... it doesn't like the symbolic link. It was looking for a directory or a file. We can't make a hard link because it is across file system. So only way is to make a directory. Suppose I make a directory and create the link inside? Let me check ...

... Sigh. Doesn't work either.
 

Riley600

Senior Member
Dec 29, 2010
199
40
Vancouver
U
I quickly tried to do by hand what the app is doing. Unfortunately it didn't work for me either. Here are the steps I followed, I wonder if anyone can identify where things went wrong.

  1. Fresh installed Angry Birds
  2. Mounted the ext2 partition of the SD card to /data/sdext2
  3. Copied /data/app/com.rovio.angrybirds.apk to /data/sdext2
  4. removed original, and created a symbolic link com.rovio.angrybirds.apk -> /data/sdext2/com.rovio.angrybirds.apk
  5. This removed Angry birds from my app list, but I thought that's Ok as long as there's adb
  6. In adb shell, tried to execute "am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.rovio.angrybirds/com.rovio.ka3d.App -f 0x10200000"
  7. No joy :-( it fails with Error: Activity class {com.rovio.angrybirds/com.rovio.ka3d.App} does not exist. If the file was physically present instead of symbolic link, this launches Angry birds

Trying to guess where did I go wrong. I am kind of sure that reboot is not required, because without rebooting I can copy the apk back and forth and launch the application. Anyway I don't have boot script modified that could mount the ext2 on boot. Wondering if that matters ...
A reboot seems to be required for the app icon to be regenerated. I'm not sure why this is but after rebooting, I haven't run into any problems so far (except market links being broken but that's a known issue).

Perhaps try rebooting with the mounting script and see if that solves your issue.
 

hardKNOXbz

Member
Jan 20, 2011
48
2
Belize City
I've rebooted multiple times with the same error.
when i link an app with Link2SD, the icon disappears, i reboot, then an icon representing the app appears (default app icon). i open app, and it force closes immediately...

seems that for some reason, my phone doesn't recognize the symbolic link, but wants the real apk from /data/app
 

AllGamer

Retired Forum Moderator
May 24, 2008
11,917
1,657
SGH-T989
AT&T Samsung Galaxy Note I717
I've rebooted multiple times with the same error.
when i link an app with Link2SD, the icon disappears, i reboot, then an icon representing the app appears (default app icon). i open app, and it force closes immediately...

seems that for some reason, my phone doesn't recognize the symbolic link, but wants the real apk from /data/app

did you ever try the old Apps2SD script?

it basically does the same thing, if that worked for you in the past, the new App should work as well
 

AllGamer

Retired Forum Moderator
May 24, 2008
11,917
1,657
SGH-T989
AT&T Samsung Galaxy Note I717
yeah, this new app, just gives it a very nice GUI to control which apps goes to SD and which one to stay in the internal storage

the old Apps2SD script just pushes everything to the SD

there was yet another App2Card, but that app was very buggy, most of the time did not mount properly

that's why the newest app is the best one available at the moment.... until we get the Froyo 2.2 ROM

then we wont need any of these
 

Mioze7Ae

Retired Recognized Developer
Dec 27, 2010
2,153
2,053
Queen City of the West
Google Pixel 7
app2ext (at least in the all-in-one optimizer) replaced the /data/app directory with a symbolic link to a folder on the sd card. The difference is that when the OS determines whether /data/app/somefile.apk is a file or directory, it doesn't matter whether /data/app is a symbolic link or not. With app2ext somefile.apk will be a file or directory because on the sd card it is a file or directory. But you can't store applications in two locations simultaneously--there no longer is /data/app separate from the sd card.

Link2SD does it differently. Instead of replacing /data/app/ with a symbolic link, it replaces /data/app/somefile.apk with a symbolic link. The idea is this allows you to mix and match symbolic links and real files. So really, Link2SD just isn't doing the same thing. I don't know what App2Card does.

In theory it should be possible to use unionfs to merge two (or more) internal and external directories. Someone in the Archos XDA forum got unionfs working last December by building unionfs.ko, so that should be possible, but we will need a unionfs.ko for our kernel.
 

kousik

Senior Member
Nov 28, 2010
235
44
Bangalore
I've rebooted multiple times with the same error.
when i link an app with Link2SD, the icon disappears, i reboot, then an icon representing the app appears (default app icon). i open app, and it force closes immediately...

seems that for some reason, my phone doesn't recognize the symbolic link, but wants the real apk from /data/app

So, I am taking reboot in good faith. I don't understand why it is required though. If the apk is made a symbolic link, the application icon goes away. If I delete the sym link and put the original apk in place, the application icon magically reappears. So I'm afraid it is not reboot, the application list is rebuilt anyway based on the fact whether it can find the class or not.

BTW this reminds me, anyone knows how to change system wide CLASSPATH? In that case, I'll add /data/sdext2 in the CLASSPATH so that system doesn't have to follow /data/app/symbolic_link but will look for the apk in /data/sdext2.
 

kousik

Senior Member
Nov 28, 2010
235
44
Bangalore
the old Apps2SD script just pushes everything to the SD

there was yet another App2Card, but that app was very buggy, most of the time did not mount properly

I tried both of them. Sadly there are issues with both. Especially if pushed everything to SD, you have a problem when it is lost. App2card was better, but many times this happened when I tried to run heavy applications like fennec (that is Mozilla firefox) my phone crashed and ext2 partition got corrupted. I had to mount the card in Linux to run e2fsck, lost some files in the process. Not good.

I like this new app's approach better. Only a few heavy apps go to SD. If the card is lost/corrupted, no problemo. Now there has been both success and failure reports. It may be the way the JVMs are built ... maybe it works with HTC/Samsung/Nexus but not Motorola? For some reason they first ensure the apk is a file and not a link? In such case it wouldn't work.
 

hellmonger

Senior Member
Oct 9, 2010
778
263
Laval
I think i figured it out... wel part of it, kousik is right! "For some reason they first ensure the apk is a file and not a link? In such case it wouldn't work." i think there is a checksum for install.. an if checksum does not match install, directory apk check on motorolas disables app/. just a theory notthing to back this up yet.... will try to test tonigh,,,,
 

kousik

Senior Member
Nov 28, 2010
235
44
Bangalore
I think i figured it out... wel part of it, kousik is right! "For some reason they first ensure the apk is a file and not a link? In such case it wouldn't work."
I am happy to report that I was wrong. :D It worked perfectly with the following steps:

  • I partitioned my SD card into 2 parts, 7G of FAT and 800M of ext3. I didn't want ext2 because for past 2 months I was trying to use one and frequent crashes led to filesystem corruption, often I had to mount the SD card to Linux and run fsck.
  • Modified /system/bin/mot_boot_mode (it is a binary file, so you rename it to mot_boot_mode.bin, and place a shellscript in place of original. This script mounts the ext3 partition on boot. This is a key to the hack.
  • Now, went to /data/app and copy the apk I wanted to move to /data/sdext2 (where the card partition is mounted). Created a symbolic link to the apk: e.g. com.waze.apk --> /data/sdext2/com.waze.apk
    • I thought permission might be important so I made /data/sdext2 as writable, and chown the apks to user "system" (as they were in original).
  • Reboot. This was another key part I was missing. On reboot, since mot_boot_mode is the first thing they run, before anything happens, ext3 partition will be mounted and apk symlinks will be available. Whoever checks and builds the list is fooled ;)
  • The applications are seamlessly available in list, and works flawlessly!
    • Well as noted in the original app, they'll disappear from the market. So you won't get notified when updates are available. The original app author fixes it in latest version. I don't know how to manipulate the market database by hand so I'll figure out some workaround. You may be better off with the app itself.

If anyone needs more help, I'll happy to provide commands in more details!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    To get Link2SD working the XT720...

    I've worked with the developer and found the issue. Motorola phones can't mount the ext2 partition and need to install the ext2.ko file (this file is installed when you install app2sd).

    Unfortunately, right now the steps are manual to install this (otherwise the apk would largely increase in size). But once this is done (you need root access, obviously), Link2SD will work. I used Root Explorer to copy ext2.ko to the necessary directory - however, I'm sure it can be done using adb commands. I'm not confident enough with my adb skills to give instructions based on that - so if someone else knows better than I, please feel free to give your own instructions.

    1) Download the ext2.ko file (zip attached)
    2) Extract it to your SD card
    3) Use Root Explorer to navigate where you extracted it to and copy the file
    4) Navigate to /system/lib/modules/ and paste the ext2.ko file there
    5) Open an adb shell with super user (su) permissions and run the following command:
    Code:
    insmod /system/lib/modules/ext2.ko
    6) Reboot - Link2SD should now mount the ext2 partition and function correctly!

    It's a solid program - I've left my Home Launcher (ADW) on the phone's memory which seems to have reduced stuttering and slowdowns from when it was installed on the SD card with app2sd.

    I'll try to answer any other questions about the installation of this program on the XT720 if you have any.

    Thanks to Bulent for working with me to find a solution to the issue with Motorola phones! :D
    1
    original topic here

    http://xdaforums.com/showthread.php?t=919326

    just in case you miss it :D

    this app is great for our phones with limited storage space
    icon14.gif


    way better to use than App2SD App and/or the App2SD script that most of us are using with the XT720

    Thumbs up To get Link2SD working the XT720...

    Thanks to Riley600


    I've worked with the developer and found the issue. Motorola phones can't mount the ext2 partition and need to install the ext2.ko file (this file is installed when you install app2sd).

    Unfortunately, right now the steps are manual to install this (otherwise the apk would largely increase in size). But once this is done (you need root access, obviously), Link2SD will work. I used Root Explorer to copy ext2.ko to the necessary directory - however, I'm sure it can be done using adb commands. I'm not confident enough with my adb skills to give instructions based on that - so if someone else knows better than I, please feel free to give your own instructions.

    1) Download the ext2.ko file (zip attached)
    2) Extract it to your SD card
    3) Use Root Explorer to navigate where you extracted it to and copy the file
    4) Navigate to /system/lib/modules/ and paste the ext2.ko file there
    5) Reboot - Link2SD should now mount the ext2 partition and function correctly!

    Currently, if you link a file to the SD card, it will not show up in the Market until it is unlinked. The developer is looking into a solution for this. Otherwise, it's a solid program - I've left my Home Launcher (ADW) on the phone's memory which seems to have reduced stuttering and slowdowns from when it was installed on the SD card with app2sd.

    I'll try to answer any other questions about the installation of this program on the XT720 if you have any.

    Thanks to Bulent for working with me to find a solution to the issue with Motorola phones! :D

    Attachment on post # 8 http://xdaforums.com/showpost.php?p=10866898&postcount=8
    1
    I've made small change in the application and released 1.0.5. What I did for Motorola users is to add insmod line to install-recovery.sh script if /system/lib/modules/ext2.ko file exists.
    In this way all you have to do manually is to copy ext2.ko file to modules directory and then install link2sd.
    You can install latest version from the app thread.

    Thanks to Riley for his contribution.
    1
    No problem :)
    It sounds like it was successful if you have 80mb free.
    1
    I believe it should work if you place those 2 lines at the end.