[Q] Not possible to create a symlink in /mnt/sdcard?

Search This thread

Vince_be

Senior Member
Jun 20, 2011
55
0
Chaineux
Hi,

Is there a way to create a symling in /mnt/sdcard (I want to point to a folder of the microSD)?

Each time I try (several times since yesterday evening...), I receive the message "Function not implemented"...

Example (/data/sdext2 is an EXT2 partition on my microSD) :

Code:
ln -s /data/sdext2/test /mnt/sdcard/Android/data/test

The usage of mount -o bind doesn't work for what I want to do ;)

Thanks in advance for your help!

Regards.
 

AzureusPT

Senior Member
Feb 27, 2008
494
56
First question of all: Are you rooted? If not, root first.

If you are rooted and using shell inside the TF, be sure you do "su" before entering any command to grant root privileges (you should have the # prompt instead of $).

Aside from that, it should work... If is still giving you trouble please post the entire log for that session (just copy paste what you've entered in the console), so we can help you better.
 

Vince_be

Senior Member
Jun 20, 2011
55
0
Chaineux
Hi,

First of all, thanks for your answer!

My TF is rooted and I use Revolver 3.11.

There are 2 partitions on my micro sd :

1) 8 GB - FAT32 - Primary
2) 22 GB - EXT2 - Primary

The second partition is mounted on /data/sdext2 (mount -t ext2 -o rw /dev/block/mmcblk1p2 /data/sdext2).

Here are the commands :

putty.jpg


Code:
su
mount -o remount,rw /
cp -pr /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld /data/sdext2/com.triactivemedia.radiocontrolrotorworld
rm -r /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld
ln -s /data/sdext2/com.triactivemedia.radiocontrolrotorworld /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld
busybox ln -s /data/sdext2/com.triactivemedia.radiocontrolrotorworld /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld

Thanks in advance for your help!

Regards
 

Vince_be

Senior Member
Jun 20, 2011
55
0
Chaineux
Hi.

Thanks for the answer.

The second partition (/data/sdext2) is an EXT2 partition. So it seems it's not the issue...

Regards.

Sent from my HTC Sensation Z710e using Tapatalk
 

Spidey01

Senior Member
Sep 16, 2011
1,058
110
Duluth
/mnt/sdcard is a fuse shim around /data/media. Crest your symlink there.

ln -s /Removable/MicroSD/folder /data/media/folder

Should generally work for most people, depending how how custom your tf is or in your case the card :)

Sent from my Transformer Prime TF201 using Tapatalk
 

Vince_be

Senior Member
Jun 20, 2011
55
0
Chaineux
Hi Spidey01!

Thanks a lot for your precious help!

You are right, I was able to create the symlink using :

ln -s /data/sdext2/Android/data/com.triactivemedia.radiocontrolrotorworld/ /data/media/Android/data/com.triactivemedia.radiocontrolrotorworld


If I go to /data/media/Android/data, everything is fine (see ls and ls -l here after) :

/data/media/Android/data # ls
com.google.android.apps.maps
com.google.android.gallery3d
com.google.android.music
com.google.android.videos
com.triactivemedia.modelhelicopterworld
com.triactivemedia.radiocontrolrotorworld
com.zinio.mobile.android.reader

/data/media/Android/data # ls -l
drwxrwxr-x media_rw media_rw 2012-01-10 15:31 com.google.android.apps.maps
drwxrwxr-x media_rw media_rw 2012-01-10 15:06 com.google.android.gallery3d
drwxrwxr-x media_rw media_rw 2012-01-10 14:57 com.google.android.music
drwxrwxr-x media_rw media_rw 2012-01-10 14:56 com.google.android.videos
drwxrwxr-x media_rw media_rw 2012-01-11 11:45 com.triactivemedia.modelhelicopterworld
lrwxrwxrwx root shell 2012-01-13 23:01 com.triactivemedia.radiocontrolrotorworld -> /data/sdext2/Android/data/com.triactivemedia.radiocontrolrotorworld/
drwxrwxr-x media_rw media_rw 2012-01-11 11:15 com.zinio.mobile.android.reader

If I go to /mnt/sdcard/Android/data, I see the link when I make a ls but not when I make a ls -l :

/mnt/sdcard/Android/data # ls
com.google.android.apps.maps
com.google.android.gallery3d
com.google.android.music
com.google.android.videos
com.triactivemedia.modelhelicopterworld
com.triactivemedia.radiocontrolrotorworld
com.zinio.mobile.android.reader

/mnt/sdcard/Android/data # ls -l
drwxrwxr-x root sdcard_rw 2012-01-10 15:31 com.google.android.apps.maps
drwxrwxr-x root sdcard_rw 2012-01-10 15:06 com.google.android.gallery3d
drwxrwxr-x root sdcard_rw 2012-01-10 14:57 com.google.android.music
drwxrwxr-x root sdcard_rw 2012-01-10 14:56 com.google.android.videos
drwxrwxr-x root sdcard_rw 2012-01-11 11:45 com.triactivemedia.modelhelicopterworld
drwxrwxr-x root sdcard_rw 2012-01-11 11:15 com.zinio.mobile.android.reader

Do you have another idea? Or should we admit that we can't use symlink with Fuse?

Thanks!!!
 
Last edited:

leomeloxp

Member
Apr 19, 2012
33
6
Jersey
I am after this as well, have you managed to get it working?

I managed to symlink to /data/media/0 and file manager sees it there, but if I go to /sdcard there's nothing either.

Isn't there a way to edit fstab to get /sdcard to mount as ext4, instead of fuse? Because all my systems are Linux, I wouldn't have trouble mounting my Tablet over my laptop (even more because I only do wireless connections via ssh)

Sent from PomPoko [TF101G] using TapaTalkHD
 

leomeloxp

Member
Apr 19, 2012
33
6
Jersey
This is how I did it.

Code:
mount -o bind /Removable/MicroSD /mnt/sdcard/extsd

I got the idea, but for what I need bind won't work :(
I want to symlink, e.g., a download folder from extsd in place of /sdcard/Download.
Bind only mounts the actual devices, subfolders won't work AFAIK :rolleyes:

Sent from PomPoko [TF101G] using TapaTalkHD
 

frefol123

Member
Dec 28, 2011
9
2
I got the idea, but for what I need bind won't work :(
I want to symlink, e.g., a download folder from extsd in place of /sdcard/Download.
Bind only mounts the actual devices, subfolders won't work AFAIK :rolleyes:

Sent from PomPoko [TF101G] using TapaTalkHD

I just tried mount -o bind /Removable/MicroSD/Download /mnt/sdcard/extsd and it worked just fine, unless that is not what you meant.


Edit: nevermind, I just realized that you wanted to redirected the /sdcard/download folder to the micro sd.
 
Last edited:

insanelycool

Member
Nov 12, 2010
36
15
DC
The adroid app "FolderMount" will accomplish this and does so quite well. If you need to do mounts (links) outside of the internal and external sdcard folders, you will need to donate (inside the app; $2) and then use the option to uncheck destination folder checks. This app works really well for any data that isnt needed right at startup.
 
[Q] Can't create symlinks on sdcard0...

Running latest Carbon ROM, rooted.

I'm trying to link my /storage/sdcard0/Pictures/Screenshots into /storage/sdcard0/DCIM so Google+ will pickup and upload screenshots automatically.

I've fired up the Terminal Emulator, su'd no problem so prompt is a #.

cd /storage/sdcard0/DCIM works fine c/l prompt showing new path, pwd shows the same.

ln -s /storage/sdcard0/Pictures/Screenshots Screenshots

Gives the message: link failed Operation not permitted.

Obviously not a FAT32 issue as sdcard0 is the internal one so I assume EXT32...

Tried ln -sf... still nothing.

Any ideas?
 
Last edited:

exec228

Senior Member
Feb 4, 2009
159
15
Astana
Xiaomi Redmi Note 7
Salut all!

I have android 4.2.2 with all user stuff stored in /data/media/0 (internal SD)
and clockworkmod backup hidden within /data/media/clockworkmod (id est it's not visible unless i navigate outside my SD with a help of some root explorer). But that's not an issue.

The issue is that I use PC based backup with Samba fileshare on smartphone and FreeFileSync running on Windows PC.

And Windows PC cannot access anything outside phone SD, so clockworkmod backups are out of syncing.

I suppose that linking /data/media/clockworkmod to /data/media/0/clockworkmod would make rom backups accessible from PC. Yeah?

So the main question is

What directories are actual and real?

I have

1) /data/media/0/
2) /mnt/shell/emulated/0/
3) /storage/emulated/0/
4) /storage/emulated/legacy/

And I cannot understand which of these is THE original one to operate with.

I would not want to create links on links on links on links...

Thank you!
 
Last edited:

Brent212

Senior Member
Mar 22, 2008
94
5
Running latest Carbon ROM, rooted.

I'm trying to link my /storage/sdcard0/Pictures/Screenshots into /storage/sdcard0/DCIM so Google+ will pickup and upload screenshots automatically.

I've fired up the Terminal Emulator, su'd no problem so prompt is a #.

cd /storage/sdcard0/DCIM works fine c/l prompt showing new path, pwd shows the same.

ln -s /storage/sdcard0/Pictures/Screenshots Screenshots

Gives the message: link failed Operation not permitted.

Obviously not a FAT32 issue as sdcard0 is the internal one so I assume EXT32...

Tried ln -sf... still nothing.

Any ideas?

This is almost exactly what I want to do and I'm having the same problem. I want to get a symlink from /storage/sdcard0/DCIM/Studio to /storage/sdcard0/Studio, because a picture editing app I use stores the images it creates in /storage/sdcard0/Studio, and I want them to be synced to "the cloud" with my DCIM folder. I've tried the same steps as chasman, and gotten the same result.
 

AndroidDeveloperLB

Senior Member
Mar 30, 2014
2,020
472
May I ask a few questions regarding symlinks?

I'm thinking of solving a problem (wrote about it here) I have of sending multiple files that have the same name but aren't allowed to be renamed (which can cause issues) , by using symlinks to them (that will have unique names).

1. Will this solution work?

2. If this should work, would it require root, even if the path is public for all?

3. If it should work, what should be the exact command?

4. Is there anything I should know about this method?

5. Is there an official API on Android for symlinks?

6. Can it work on any device?
 

monkeyfncoconut

New member
Aug 11, 2015
2
1
So I was able to create a symlink to external sdcard on LG g3 running rooted stock kit Kat Rom. I successfully changed Groove's (formerly xboxmusic) offline storage to external sdcard.

The following command was successful in creating a link, but Groove was unable to download music to the directory presumably due to permissions on /many

su
cp -rp /data/media/0/Android/data/com.microsoft.xboxmusic /storage/external_sd
rm -r /data/media/0/Android/data/com.microsoft.xboxmusic
ln -s /mnt/media_rw/external_sd/com.microsoft.xboxmusic/ /data/media/0/Android/data

After these commands, Groove was producing errors stating that there was not enough disk space. As said before, I believe this was due to it's lack of permissions to /mnt

Replacing the last command with the following worked and offline music is now downloaded to external sd card
ln -s /storage/external_sd/com.microsoft.xboxmusic/ /data/media/0/Android/data

Given my experience, you cant create a link in a fuse fs, but you can create a symblink to a fuse fs.

Hope this helps.
 
Last edited:
  • Like
Reactions: jockovonred

hulkinBrain

Member
Jul 3, 2014
45
15
a small issue

thanks!! this command worked like a charm, i was able to link /sdcard to /storage/sdcard1 to change the default storage location!! Again thankyou very much!:D:D

you cant access the internal sd card later on after running this command. Only option is to reboot and revert back to the default settings.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    /mnt/sdcard is a fuse shim around /data/media. Crest your symlink there.

    ln -s /Removable/MicroSD/folder /data/media/folder

    Should generally work for most people, depending how how custom your tf is or in your case the card :)

    Sent from my Transformer Prime TF201 using Tapatalk
    1
    So I was able to create a symlink to external sdcard on LG g3 running rooted stock kit Kat Rom. I successfully changed Groove's (formerly xboxmusic) offline storage to external sdcard.

    The following command was successful in creating a link, but Groove was unable to download music to the directory presumably due to permissions on /many

    su
    cp -rp /data/media/0/Android/data/com.microsoft.xboxmusic /storage/external_sd
    rm -r /data/media/0/Android/data/com.microsoft.xboxmusic
    ln -s /mnt/media_rw/external_sd/com.microsoft.xboxmusic/ /data/media/0/Android/data

    After these commands, Groove was producing errors stating that there was not enough disk space. As said before, I believe this was due to it's lack of permissions to /mnt

    Replacing the last command with the following worked and offline music is now downloaded to external sd card
    ln -s /storage/external_sd/com.microsoft.xboxmusic/ /data/media/0/Android/data

    Given my experience, you cant create a link in a fuse fs, but you can create a symblink to a fuse fs.

    Hope this helps.