I am trying to create symbolic links of /data/sdext2/app/* on /data/app.
This is what I did in adb shell
ln -sf /data/sdext2/app/* /data/app/
But it is telling "link failed No such file or directory".
Note that none of the partitions are of FAT32 format.
And without -f option it says "link failed File exists".


ln only takes 2 arguments at most (not counting options), the ../* wildcard however expands to all filenames in the folder. Just do place an echo before ln to see what happens.

Do it one by one this way:

cd /data/sdext2/app
for i in *; do ln -s /data/sdext2/app/"$i" /data/app/;done


for i in /data/sdext2/app/*; do ln -s "$i" /data/app/$(basename "$i");done


Ok, this is how it works on my device:

me@workstation:~$ adb shell
shell@android:/ $ id
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),[...]
shell@android:/ $ su
shell@android:/ # id
uid=0(root) gid=0(root) groups=1003(graphics),1004(input),1007(log),[...]
shell@android:/ # cd /data/
shell@android:/data # ln -s /data/sdext2/app/banana.app /data/app/cucumber.app
shell@android:/data # ls -l /data/app/cucumber.app
lrwxrwxrwx root root 2012-11-06 22:30 /data/app/cucumber.app -> /data/sdext2/app/banana.app

  • Will that link hidden files/folders? Nov 6 '12 at 16:13
  • Hehe :-) Of course not, but the original attempt wouldn't do that either (so I didn't bother).
    – ce4
    Nov 6 '12 at 16:50
  • still same problem.. i can use other apps like root explorer and link2sd to create soft links.. wonder how it is done.. Nov 6 '12 at 20:00
  • See my update, also read more on the ln command here.
    – ce4
    Nov 6 '12 at 21:38
  • so.. what do u exactly want me to do?? Nov 7 '12 at 16:09

I made it this way

cp -a /sdcard/olivetree /sdcard/sdcard-disk/olivetree
rm -rf /sdcard/olivetree
ln -sf /sdcard/sdcard-disk/olivetree /sdcard/olivetree 

But for wired reasons it didn't work or me in android 'Terminal Emulator' but smoothly worked from my PC via Putty and android 'SSH Droid'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.