[Q] make links between ext4 and fat32 - General Questions and Answers

Because my ROM is big enough(around 8G), and my SDCard has been full with various files, so i want to link a big file stored in ROM to SDCard so as to save the treasure space of SDCard( the big file cannot be identified by a software except it is in /sdcard patition ) first i take an test to validate the method: try to link a file /data/test.mp3 to /sdcard/test_fat32.mp3, then in the terminal (#su), i tried to make a symbolic link like this :
Code:
ln -s /data/test.mp3 /sdcard/test_fat32.mp3
but failed:
ln: /sdcard/test_fat32.mp3: Operation not permitted
Googling for a while, and i found that i cannot create symbolic links with fat32, i dont want to format the SDCard to ext4, because i want to make such an app to share with my friends. you surely cannot demand everyone of the format, what's more, maybe many apps cannot identify ext4 files. does anyone have a good idea to realize it? or some other ways to access inner files and fake the app that it is a file in /sdcard? any help appreciated!

Related

File manager that can create symbolic (soft) links?

I want to move my ringtones and notfication sounds from internal storage to /sd-ext. To do this I need to create a symbolic link from /system/media/audio -> /sd-ext/media/audio/
It seems that root explorer is unable to create symbolic links so are there any other android apps available that can do this? I really don't want to have to install the android SDK just to do this so is there an easy way to do this from the phone?
Cheers,
Richard.
If your rooted and have terminal installed you should be able to enter the following:
ln -sf /sd-ext/media/audio /system/media/audio
I haven't tried it myself in android but its what would work in a regular linux environment.
technoplunk said:
If your rooted and have terminal installed you should be able to enter the following:
ln -sf /sd-ext/media/audio /system/media/audio
I haven't tried it myself in android but its what would work in a regular linux environment.
Click to expand...
Click to collapse
Thanks that did the trick. I installed Terminal Emulator from the market and su'd then created the link. After a reboot all my ringtones and notifications are now working from my sd-ext partition
Cheers,
Richard.
Glad to hear it worked, at the time I replied I didn't even own an Android phone yet.
This weekend I finally picked up a Desire HD.
I am trying to do the same thing on an elocity a7 ... rooted, running froyo, Dexter's mod 1.42. Terminal has su. I enter the following:
Ln -sf /sdcard/sdcard-disk/olivetree /sdcard/olivetree
I get the message: Link failed. No such file or directory.
Both directories exist and contain files. I have tried with various combinations of directories existing with or without files ... same thing.
Any ideas? Thanks
aimeehammond said:
I am trying to do the same thing on an elocity a7 ... rooted, running froyo, Dexter's mod 1.42. Terminal has su. I enter the following:
Ln -sf /sdcard/sdcard-disk/olivetree /sdcard/olivetree
Both directories exist and contain files. I have tried with various combinations of directories existing with or without files ... same thing.
Any ideas? Thanks
Click to expand...
Click to collapse
Assuming /sdcard/sdcard-disk/olivetree and /sdcard/olivetree are both directories without any functioning links and contain some files that differ from each other, I would do enter the following in the terminal:
cp -a /sdcard/olivetree /sdcard/sdcard-disk/olivetree
rm -rf /sdcard/olivetree
ln -sf /sdcard/sdcard-disk/olivetree /sdcard/olivetree​
These steps copy all data from one directory to the other.
Delete one of the directories.
Link the existing directory to the removed directories location.
Thanks, Technoplunk. Now I get the message:
Link failed. Operation not permitted. :|
Does your lines in the terminal begin with a hash "#" character? If it does not then your not running the commands as root.
Try typing 'su' without the quotes then running the commands I suggested above.
Yes, I was already running in root ... did the su ... got the #
Thinking a little harder about your problem I realize your trying to do a soft link from one portion of a fat32 partition to another. I suspect the issue might be that you can't create soft links on a fat32 partition as it probably isn't supported. Microsoft created fat32 and never supported soft links on it.
It worked for laxity because he was linking from an ext3 or ext4 partition to the fat32. The actual link resided on the ext partition.
The file structure of this tablet seems a bit weird to me. /sdcard is the tablet's internal storage. The sub-directory /sdcard/sdcard-disk is the micro sd card. I would have expected it to be in the root directory of the tablet, but it's not. However, I didn't think the internal storage was FAT32. Is it??
I'm baffled.
The "mount" command will list all partitions and their types. Its a bit verbose on my phone. Any fat32 partitions will probably say vfat rather than ext(#).
Aha. Several partitions (/system /data /misc /cache) are ext3.
/sdcard and /sdcard/sdcard-disk are FAT32.
Is there a way to format the internal /sdcard as ext3?
Thanks so much for your help!
I recommend poking the people in the Elocity A7 section of the forums, they have more experience with your particular device and can likely tell you if it is safe to try or not.
I should also add that changing those partitions to ext3 would mean you could no longer drag and drop files from a Windows pc as Windows can't read that partition type.
Same question:
laxity said:
...
It seems that root explorer is unable to create symbolic links so are there any other android apps available that can do this?
...
Click to expand...
Click to collapse
I don't mind if it's free or paid application!
Problem solved!!!
Root Explorer v2.17 (estimated releasing date tomorrow, 10/28/2011) has "Link to this folder" / "Link to this file" and "Create link" options!
No more painful usage of terminal emulators on small screens!
Thank you Speed Software !
I have a similar problem. The music bib stored by google music should reside on my second sd card. In the moment the app stores the music automatically on the first internal sd card. But I have the same problem that the internal sd card is fat32. So is there any solution to move my bib to the second sd card?
Thanks
Hi there!
I have a similar situation as I got deleted my "lib" file, that is a symbolic link, from my "com.android.mms" folder.
From RootExplorer I remember the file pointing to "... -> com.android.mms", so what am I supposed to type in Terminal Emulator?
Tnx in advance.
Sent from my Samsung Galaxy S5 SM-G906K using TapaTalk
Hello,
Sorry to unhearth this post but I have a similar problem and these command lines do not seems to work.
technoplunk said:
Assuming /sdcard/sdcard-disk/olivetree and /sdcard/olivetree are both directories without any functioning links and contain some files that differ from each other, I would do enter the following in the terminal:cp -a /sdcard/olivetree /sdcard/sdcard-disk/olivetree
rm -rf /sdcard/olivetree
ln -sf /sdcard/sdcard-disk/olivetree /sdcard/olivetree​These steps copy all data from one directory to the other.
Delete one of the directories.
Link the existing directory to the removed directories location.
Click to expand...
Click to collapse
On my daughter's SGJ5 running 6.0.1, I have an issue with Musical.ly taking too much space because it is storing video files on the phone memory and wont be moved to SD card.
So I got inspiration from your post and thought of creating a symbolic link between the folder where Musical.ly stores its videos to another one on the SD card: respectively '/storage/emulated/0/Android/data/com.zhiliaoapp.musically/files/localvideos' on the phone memory and '/storage/6561-3337/Videos/musically' which I created on the SD card.
I ran the following command using adbputty:
cp -a /storage/emulated/0/Android/data/com.zhiliaoapp.musically/files/localvideos /storage/6561-3337/Videos/musically
rm -rf /storage/emulated/0/Android/data/com.zhiliaoapp.musically/files/localvideos
ln -sf /storage/6561-3337/Videos/musically/localvideos /storage/emulated/0/Android/data/com.zhiliaoapp.musically/files/localvideos
cp and rm worked fine but when I try to run the ln command I get the following error:
ln: cannot create symbolic link from '/storage/6561-3337/Videos/musically/localvideos' to '/storage/emulated/0/Android/data/com.zhiliaoapp.musically/files /localvideos': Operation not permitted
Edit: I tried the following command instead (inspired from "https://forum.xda-developers.com/showpost.php?p=62273638&postcount=18")
ln -sf /storage/6561-3337/Videos/musically/localvideos /data/media/0/Android/data/com.zhiliaoapp.musically/files
and that works for creating the symlink but Musical.ly does show anymore Private videos, nor is it possible to create new ones.
Could you please help me with this?
Cheers

Howto: Moving /cache/download to SD to get more internal space.

I did a little experiment. I do not know the full implications & risks involved in doing this. So, follow this at your own risk. Consider this an alpha.
Android phones come with limited internal space. We have tried to redistribute this space to be able to install more app. We have tried moving dalvik-cache to cache. We have had data2system ROMs. We have App2SD. We have Link2SD. We even have Mur4ik's Custom Boot Builder for GT540 Optimus which allows us to modify the partition table. Now, we are going to try move the /cache/download to the SD. I don't know if someone tried this & covered this elsewhere but I didn't come up with any references so far.
Considering the uncertainty around this idea, I'll keep the instructions technical assuming only those who know their know-how would try this. Devs are free to use this in their ROMs & credits with a link to this post would be much appreciated.
Now, the steps.
The following steps all assume busybox is already present. If you don't have it, install it using the installer app from the market.
You can use adb shell or Terminal Emulator. Once you gain access to the shell.
Determine the mount point of SD-ext.
Type df and with this you will be able to see the partitions mounted on your device. This is likely to be the mount point of /dev/block/mmcblk0p2. If for some reason you can't find sd-ext, it means the ext partition didn't mount properly.
In my phone, the sd ext partition is mounted at both /sd-ext and /data/sdext2. I'll use /sd-ext in the other steps, modify to suit your own path when you follow the rest of the steps.
Make a new directory in SD-ext.
cd /sd-ext/
mkdir download
Clean the /cache/download.
Type rm -r /cache/download
Now, make a symlink.
ln -s /sd-ext/download /cache/download
I'd also recommend adding rm /sd-ext/download/* to init.d or userinit.sh since the cache may become big with time.
If you try this, do post your feedback.
This might have multiple advantages,
Your cache partition is not likely to fill up and no more failed app downloads.
Partition can be edited to further reduce /cache size and so increasing /data size.
I intend to make a script/app to automate all steps but I'm looking for feedback first.
This was done by me a while ago. http://forum.xda-developers.com/showthread.php?t=1168675 Anyway, good job.
despotovski01 said:
This was done by me a while ago. http://forum.xda-developers.com/showthread.php?t=1168675 Anyway, good job.
Click to expand...
Click to collapse
Hmm. I did miss it. I didn't search on GT540 forum specifically but I did search on Google and XDA but didn't come up with anything.
And, I think linking to ext would be a better idea than linking to FAT32 since ext2/ext3 is pretty fast.
And, thanks. Nonetheless, your topic is on GT540 forum. This is in General forum and so applies to all phones. And, the main reason I wanted it was Star Legends and Pocket Legends. =D
Check out S2E on the market. It has multiple options on moving stuff to sd-ext.

Make MicroSD part of internal storage

Is there a way I can make the MicroSD just an extension of the internal storage? It would be nice to store apps on it as well. Is this possible?
Apps2SD lets you put apps on, and ICS lets you use it pretty much the same way as the internal. So no need really.
If you really wanted to it would involve symlinking partitions, but I'm not entirely sure as to the process
Oh that's great because I remember honeycomb didn't allow that. When an app is on sd will its files reside on sd? For example DoggCatcher stores its files on internal and I would really like to have those files on my MicroSD. Would a symbolic link work to do this?
Edit: tried app2sd but it couldn't find SD card because of how TF names internal as SD.
Trying out Link2SD because it seems promising. I think it creates symbolic links.
Not symbolic links
Symlinking, the ls command, think of it as a linux-shortcut command perse.
I find that Titanium backup works very well, but it needs root.
How do you do it in Titanium? I can't figure out how. Thanks for the help so far
Edit: Also if for example Doggcatcher's files are on internal and it won't let me specify where I want to store them how would I move them to MicroSD?
Really sorry, I was getting TI backup mixed with something else.. X.x
https://play.google.com/store/apps/...wOSwiY29tLndvbmd4bWluZy5hbmRyb2lkLmFwcDJzZCJd
Try this--
and this with root-- https://play.google.com/store/apps/details?id=com.leinardi.setinstalllocation&feature=also_installed (works well, my ROM has built in support for this though, most big apps (games) can be moved with the native ics feature. hunt through settings.
Thanks for the help! Is the TF internal filesystem Fat32 by default?
Thing O Doom said:
Not symbolic links
Symlinking, the ls command, think of it as a linux-shortcut command perse.
I find that Titanium backup works very well, but it needs root.
Click to expand...
Click to collapse
No offense intended, but I'm not sure I understand what you are saying. Symlink is just a short name for a symbolic link, as far as I could find (from Wikipedia):
In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.
Click to expand...
Click to collapse
And the "ls" command (without any other parameters) just lists the files in the current directory in Linux and Unix type OSs.
---------- Post added at 12:52 AM ---------- Previous post was at 12:50 AM ----------
taC nayN said:
Thanks for the help! Is the TF internal filesystem Fat32 by default?
Click to expand...
Click to collapse
The internal is ext4, I believe, a Linux filesystem type.
I'm trying this to create soft link so I can have DoggCatcher files on MicroSD instead of Internal but when I tried
ln -sf /removable/MicroSD/DoggCatcher /sdcard/Doggcatcher
it says No such file or directory. What am I doing wrong? My MicroSD is exFAT.
Sorry, I'm getting so mixed up today. *blarg* Thank you for pointing that out. Id even know what I was thinking. -sleep time-
myandroiid.blogspot.com/p/how-to-use-your-sdcard-as-internal.html
HERE IS COMPLETE GUIDE ITS AWESOME
Sent from my HTC Salsa C510e using xda premium
taC nayN said:
I'm trying this to create soft link so I can have DoggCatcher files on MicroSD instead of Internal but when I tried
ln -sf /removable/MicroSD/DoggCatcher /sdcard/Doggcatcher
it says No such file or directory. What am I doing wrong? My MicroSD is exFAT.
Click to expand...
Click to collapse
If it is the same as mine, then it should be "ln -sf /Removable/MicroSD/DoggCatcher /sdcard/DoggCatcher". Note the capital R in removable. Now, if DoggCatcher is a directory name then you may need to add a "/" at the end of one or both of your target and source. Not sure if the 'f' option works with busybox, you may need just 'ln -s'. Also, the normal command structure is " ln -s(f) source-file link-name ". Make sure you have the parts in the intended order.
Allright I got everything *mostly* figured out now. I don't necessarily want to make MicroSD primary because they are the same size so I just want to extend it. I figured out how to move DoggCatcher via the app (I'm an idiot)
I still would like to know how to create soft links between SD and internal though because it keeps failing.
sidneyk said:
If it is the same as mine, then it should be "ln -sf /Removable/MicroSD/DoggCatcher /sdcard/DoggCatcher". Note the capital R in removable. Now, if DoggCatcher is a directory name then you may need to add a "/" at the end of one or both of your target and source. Not sure if the 'f' option works with busybox, you may need just 'ln -s'. Also, the normal command structure is " ln -s(f) source-file link-name ". Make sure you have the parts in the intended order.
Click to expand...
Click to collapse
Thank you so much! That was the problem. Greatly appreciated.

copying link2sd's sdext2 ( ext4 ) partition to another sd card

like you might have guessed i am a windows user and i have bought a new bigger sd and i was trying to move the contents created on the sdext2 partition that was created using ext4 file system across to the newer card , now i understand that these files have to maintain permissions or things would get ugly , i am open for suggestions , i have a theory thought that i can use tar to compress the folder and maintaining permissions to the fat32 partition , copy it to windows then decompress it over the other card , but as expected i am getting all sorts of error messages on trying all syntax i could find online , what's the proper syntex to compress the entire partition into 1 single file and moving it to fat32 partition ?
on a side notice this was just me thinking out loud , if anybody has a better solution please feel free to share !
thanks in advance

LinuxSE Problem ? ln -s gives permission denied

Hi, for Termux on my Galaxy S5 (Android 10,LineageOS 17.1) I need additional space with an Ext4 FS.
I have lots of space on my SD card (adoptable storage) but not on my internal storage.
For that I have created a 4G file, formatted it as Ext4, and loop mounted it on /mnt/T.
I cannot access this as a normal user under Termux. Therefore I tried
bindfs -u10218 -g10218 /mnt/T /data/data/com.termux/files/home/T
As a non-root user under Termux I can cd to that folder, I can read, create and write to files.
But I cannot create a symlink from one file in T to different name in T.
I suspect a LinuxSE problem. I don't know how to change the SE context. It doesn't look like a bindfs problem. It occurs in the kernel as shown by strace.
Many thanks for any hints or pointers,
Helmut

Categories

Resources