[Q] Symlink on /sdcard - Nexus 4 Q&A, Help & Troubleshooting

hello there!
so im trying to symlink a subfolder to a folder on the root of my sdcard, and quite obviously i dont have a physical sd as i have a nexus 4, so the partition i created the symlink on is /data/media/0.
The story (just the reason behind it, not necessary to read):
here is why i want this symlink:
i want to use the helium backup app from the clockworkmod team, which creates a 'carbon' (old name of the app) folder on /sdcard.
i want to sync the local backup folder to my drive, for which i use the foldersync app which syncs everything found in /sdcard/drive, so i want to have the carbon folder in /sdcard/drive and create a symlink in /sdcard to it.
the reason i dont use heliums implemented drive backup option is that i have no idea where it stores all the backed up data and cant keep track of its storage usage and cant organize it the way i want to.
unfortunately helium has no option to move its local backup folder, and the dev team didnt answer my email about the backup location on drive.
whatever, back to topic...
i have created the symlink with this command:
Code:
ln -s /data/media/0/drive/carbon /data/media/0/carbon
this is working, when i use the /data/media/0 path, but when i try to look into the content of /sdcard/carbon (which obviously the app uses too), i get an error: function not implemented.
if i use this command:
Code:
ln -s /sdcard/drive/carbon /sdcard/carbon
i get the same error (function not implemented), and the symlink does not get created.
is there a way to create a working symlink for /sdcard?
i could try symlinking /sdcard to /data/media/0 (i would have to delete the existing /sdcard link, which i have no idea how is linked) with adb, but i dont know if it could work. has anyone tried that before?
ps: i have googled it and also looked for a solution on xda, havent found a solution yet...

bump

nobody? :/
sent from my Nexus 4...

Not sure why symlink isn't working. You can try binding folders which works in many cases where symlink does not.
mount -o bind src_folder dest_folder
You might need to put this in init.d script so that the bind happens on every boot as it won't stick across reboots.
Most likely the problem you are facing is because of unified filesystem that's implemented. i.e. a single physical partition acts as two virtual partitions one containing /data and other /sdcard
Sent from my Nexus 4 using xda premium

You can't symlink on sdcard because the /sdcard is formatted either fat32 or fatx (can't remember which). Neither of which supports symlinks
Sent from my Nexus 4 using xda app-developers app

Alex240188 said:
You can't symlink on sdcard because the /sdcard is formatted either fat32 or fatx (can't remember which). Neither of which supports symlinks
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
The sdcard on nexus isn't FAT as its not mounted as USB mass storage but over MTP.
Phones which support mounting as USB drives use FAT formatted sdcard partitions so that it can be read by Windows natively.
Sent from my Nexus 4 using xda premium

That's interesting because my previous phone. HTC one x /sdcard was 100% formatted fat because it was mtp in android. But you could still Mount as ums in recovery
OK, just had a quick look. guess you are right, /sdcard/ is formatted as EXT4 so symlinks should work fine.
edit
its mounted as ext4 in recovery.
in android its mounted as fuse which is why the symlink doesnt work
confirmed.
i just booted into recovery
Code:
adb shell
~ # ln -s /sdcard/carbon/ /sdcard/drive/carbon/
ln -s /sdcard/carbon/ /sdcard/drive/carbon/
~ # cd /sdcard/carbon
cd /sdcard/carbon
/sdcard/carbon # ls -l
lrwxrwxrwx 1 root root 21 Jul 1 21:35 carbon -> /sdcard/drive/carbon/
however upon rebooting the symlink is lost as it is no longer been mounted as ext4
Sent from my Nexus 4 using xda app-developers app

atulalvenkar said:
Not sure why symlink isn't working. You can try binding folders which works in many cases where symlink does not.
mount -o bind src_folder dest_folder
Click to expand...
Click to collapse
unfortunately, this doesnt work, i get this:
/system/bin/sh: bind: -o: unknown option
i also tried mount --bind src dest, but that doesnt work either.
so there is no way to create a symlink or any other way to link a folder to another?

zakoo2 said:
unfortunately, this doesnt work, i get this:
/system/bin/sh: bind: -o: unknown option
i also tried mount --bind src dest, but that doesnt work either.
so there is no way to create a symlink or any other way to link a folder to another?
Click to expand...
Click to collapse
I tested and it was working fine. Looks like you just typed bind -o instead of mount -o bind. It should be "mount -o bind src_folder dest_folder".
There is an app which does this for you. I haven't used it personally but you can try. Check here http://forum.xda-developers.com/showthread.php?t=1410262
Sent from my Nexus 4 using xda premium

atulalvenkar said:
I tested and it was working fine. Looks like you just typed bind -o instead of mount -o bind. It should be "mount -o bind src_folder dest_folder".
There is an app which does this for you. I haven't used it personally but you can try. Check here http://forum.xda-developers.com/showthread.php?t=1410262
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
I am looking for a solution as well as my links on my n10 no longer exist. Nothing works including factory flashing the device back to stock.

Related

Using B&N Storage normally

One of the biggest issues I had with my nook was the 16/1GB division between content I can load and content from B&N/etc. Not being able to use that 16GB how I wanted was something I set forth to fix. Here is my solution to make this usable to non-rooted apps.
1) Root if not already rooted.
2) Make a directory inside of /data. I chose /data/usrdata.
3) remount / as RW with the command mount -o remount,rw -t rootfs rootfs / (credit to whomever wrote the nook&zergy.bat 1 click root. Sorry, it's been a long night, just let me know who and I'll edit)
4) mkdir /mnt/internal . We need somewhere to mount /data/usrdata/ and /mnt is public enough.
5) busybox mount -o bind /data/usrdata /mnt/internal. Mounts /data/usrdata to /mnt/internal.
6) For good measure, chmod 777 /mnt/internal and chmod 777 /data/usrdata.
Now, /mnt/internal should have whatever free space /data has, and should be read/write accessible from any program. A quick test with touch+terminal emulator shows new files as being created with RW permissions for all.
Alternatives: When I was initially thinking about ways to do this, my first reaction was to just open up /data to be read only to all, then have my usrdata folder be read/write all. However, I know part of android's app security model depends on some of these permissions. While I can't think of anything breaking or sensitive data being leaked, I decided against it. If anyone has any thoughts as to that scenario, I am very interested in hearing about it.
USB support: This will *not* be mountable under USB. Unfortunately you are still limited to transfering the data from a computer to the B&N internal storage or SDcard first, then moving the data internally. The problem that I see with this is similar to my understanding of the galaxy nexus situation, where the system can't unmount its /data partition and let the USB host take over. Another alternative to this could be to write an image file and mount that over usb (I've done this on my Evo, it worked so-so). Problem with that is that it really wouldn't grow/shrink with the storage. I suppose you could do some shell trickery and pipe it through gzip somehow, but that wouldn't help very much.
Let me know what you think and if you have any ways to improve this.
UPDATE: Persistance:
To make this persistant across reboots, run these commands as root:
1) mount -o rw,remount -t ext4 /dev/block/platform/mmci-omap-hs.1/by-name/system /system
2) echo mount -o remount,rw -t rootfs rootfs / >> /system/bin/clrbootcount.sh
3) echo mkdir /mnt/internal >> /system/bin/clrbootcount.sh
4) echo busybox mount -o bind /data/usrdata /mnt/internal >> /system/bin/clrbootcount.sh
5) echo mount -o remount,ro -t rootfs rootfs / >> /system/bin/clrbootcount.sh
All this does is put the following at the end of clrbootcount.sh
mount -o remount,rw -t rootfs rootfs / #Remounts root as RW. Root is regenerated at each reboot, so /mnt/internal is never going exist on a fresh startup
mkdir /mnt/internal #make /mnt/internal, see above
busybox mount -o bind /data/usrdata /mnt/internal #Binds the directory
mount -o remount,ro -t rootfs rootfs / #remounts root as RO. Unsure if this is necessary, but since it runs as RO, its probably better safe than sorry.
Thanks to eded333 for mentioning a good place for the script.
Edit: Doh, can a mod please move this to the nook tablet general forum? I must have failed reading...
This file autostarts each time you boot:
/system/bin/clrbootcount.sh
Add what you want at the end, and it will autoexecute it.
Wouldn't it be easier to just make a symbolic link to any partition you want to use?
Edit:
XD, didn't read you'r edit, , anyway maybe this works also for you.
Out of curiosity, what would symlinking to /sdcard do exactly? I don't think I'm quite following what you're saying. If I'm linking a directory to /sdcard, that would just go to the microsd card slot, which isn't what I was intending to do. The Nook tablet (I accidently posted this in the wrong forum, that much helps too) has 16GB of storage that is internal on /data, and can't be used through normal means. My goal was to be able to use this 16GB of data outside of rooted apps. Maybe I'm not understanding completely as I am a bit sleep deprived at the moment.
Thanks for the recommendation for the startup script though! I will definitely give that a shot and see if that makes this persist across reboots.
Yeah, I though you were talking about the NST which only has 2gb of internal memory and 200 mb left to use if you dont repartition, dont really know how the partitioning is on the nook color but just symlinking (hardlinks) the folder you want on a partition to another folder on another partition which has more space would resolve the issue.
Edit:
If i'm not getting it wrong and you want more space than the nook gives you, to store content. This should work, hope I'm not wrong
Yeah sorry about that. I thought I was in the nook tablet section and when I went back because I got new email, it looked very different. Imagine what posting in the wrong forum can do...
By default the nook tablet has 16GB of NAND, with 14 or 15GB set as /data and 1GB as /media thats accessible over usb. I've read a lot of people disliking the idea of wasting all that space, myself included, so that's what spurred it. Initially I was going to have the remount command ignore FS permissions since it was public anyway, but I couldn't do that with bind.
gameman733 said:
Yeah sorry about that. I thought I was in the nook tablet section and when I went back because I got new email, it looked very different. Imagine what posting in the wrong forum can do...
By default the nook tablet has 16GB of NAND, with 14 or 15GB set as /data and 1GB as /media thats accessible over usb. I've read a lot of people disliking the idea of wasting all that space, myself included, so that's what spurred it. Initially I was going to have the remount command ignore FS permissions since it was public anyway, but I couldn't do that with bind.
Click to expand...
Click to collapse
Don't know if this sounds dumb, but you can try to mount as rw the partition you want to use, then use ln -s + the folders on the partitions you want to link and see if it works, add the commands at the end of the file I showed you and look if it works correctly. Make sure the folders you use have sufficient permissions and that the partition is mounted as rw.
Edit:
You could allways resize the partitions without any inherent problem, make a backup before trying this.
I found it
need help with /mnt/internal please
I have been troubleshooting this for several hours. I have rooted my NT with latest indirects n&Z .bat. Everything is fine with that. I followed the instructions from kenblat for mounting the reserved data space that is now accessible to me through Root Explorer and making it persist through reboot with the new clrbootcount.sh. Here is where things are falling apart for me....a directory called /internal is appearing as it should in /data/mnt, and I created an "audio" directory there, and I have been able to copy a few songs into it.....but, at some point, the whole system freezes, never finishes the "paste" part, and I have to force reboot in order to get anything running again. When reboot, any and all of the material that I did manage to copy/paste into the /mnt/internal directory is GONE. I have tried changing permissions, but so far I have gone through this at least 9 times (I am a very persistent person when it comes to this stuff) and always the system stops functioning in the middle of pasting. My /internal folder is set to RWall, /data is rwxrwx--x, usrdata is rwall. clbootcount.sh is set to ---rwxr-x. I can't imagine that it really is a permmissions problem because of the fact that i am able to copy SOME files, a few at a time, without a problem. Can anyone possibly help me? Thanks.
IT WAS NOT A PERMISSIONS ISSUE. DISCOVERED BUSYBOX WAS NOT INSTALLED. (DON'T KNOW HOW IT GOT UNINSTALLED) I OPENED NINJAMORPH AND IT DID ITS CHECKS AND THERE IT WAS, NO BUSYBOX INSTALLED. SO I REINSTALLED IT, NOW MOUNTS INTERNAL AND PERSISTS UPON REBOOT. NO WONDER I HAD PROBLEMS.
Need help.
I have been trying to everything step by step as it says here but it is not workign for me. I just recently rooted my nook tablet. I was wondering, maybe a video tutorial would more.

[Q] Spoof sd card mount

I am a big fan of books. This is why I have a nook simple tablet. But after being introduced to Overdrive, which I am sure at least one of you has heard of (Googie), I want to be able to download ebooks from overdrive. The only problem is, I would need an external storage device to save these from opera mobile. This is a bit unsettling, seeing as I don't have a micro sd card. (don't ask.)
So, my question is, is there a way to fool the nook into thinking an sd card is inserted?
Thanks in advance!
Since sdcard is mounted under /sdcard directory, I believe mounting (binding) a directory under writeable partition (e.g. /data/sdcard) to /sdcard might be enough.
May need to also link to /data/sdcard as well as the /sdcard. This can be done with symlinks or mounting. Ie mount said partition to /data/sdcard then symlink from /data/sdcard to /sdcard. Though the /sdcard symlink may already be there
Sent from my ADR6300 using Tapatalk
How would one do this? I just recently adopted android and I do not know much.
it might require modifications to the ram disk within the boot.img. or possibly using ln -s /data/sdcard /sdcard after boot is completed in a terminal. You may need to delete the /sdcard dir first and set proper permissions
Looking in a terminal you will need to symlink the emmc(internal memory) to /data/sdcard. ln -s <emmc dir> /data/sdcard. You may need to delete the /data/sdcard dir first.
Sent from my ADR6300 using Tapatalk
Hmm...
I'm just going to get an sd card. Thanks anyway, it's interesting to know you can do that.

[Q] directory bind to play game with OTG usb drive

I am facing this issue with my Nexus 7 4.2.1 stock ROM rooted.
I am trying to move game data to a usb flash drive to save space, and then mount bind the directory using an OTG cable.
When I use StickMount I can see the usb drive at /sdcard/usbStorage/sda1 using ES File Explorer.
Then I use Terminal Emulator to mount bind the directory:
[email protected]:/ $ su
[email protected]:/ # mount -o bind /sdcard/usbStorage/sda1/test /sdcard/Android/data/test
These seems to work because if I navigate the directories using Terminal Emulator, I see how the test directory was linked and the data can be seen.
But if I use ES File Explorer to go to the same directory (/sdcard/Android/data/test), folder is empty, and if I try to run the game, it tries to download again because can't see the data in that directory.
So my question is if I can do the directory bind using other source like /data/media, /storage/sdcard0, or /mnt/sdcard instead of just /sdcard to make ES File Explorer and the game to see the data directory?
It is good to verify with Terminal Emulator that the directory bind worked but not good enough to make the game works saving internal storage space.
Thank you.
http://forum.xda-developers.com/showthread.php?p=35960052
Directory bind does not work on android 4.2.1!
The above thread has more details, hopefully the developer of directory bind app is looking for a solution!
Sent from my Nexus 7 using XDA Premium HD app
I don't need to use the app. I can do it just typing the unix/linux commands.
rabascal said:
I don't need to use the app. I can do it just typing the unix/linux commands.
Click to expand...
Click to collapse
The new file structure in android 4.2.1 is causing problems! The app i believe uses the bind command as well! So it is the bind command that doesn't work properly!
Have you tried using Sy links instead of binding the folder?
Use the following command to symlink
ln -s [source folder] [destination folder] where source and destination are path names
Thank you for the suggestion.
I tried several times on different directories but it didn't work.
I read somewhere that symlink does not work with FAT32. Is this my problem?
The USB flash drive that I am using where I copy the fifa 12 game directory is FAT32.
Do I need to have the usb storage formatted as ext2 or ext4? How can I do that? I am guessing I can't do it on Windows, right?
rabascal said:
Thank you for the suggestion.
I tried several times on different directories but it didn't work.
I read somewhere that symlink does not work with FAT32. Is this my problem?
The USB flash drive that I am using where I copy the fifa 12 game directory is FAT32.
Do I need to have the usb storage formatted as ext2 or ext4? How can I do that? I am guessing I can't do it on Windows, right?
Click to expand...
Click to collapse
Try formatting it to ext3..it will delete the data of course so take a backup.on windows use mini tool partition manager...its free and can format to any ext.

Link2SD on Amazon Fire TV

Problem statement
The Amazon Fire TV has a limited memory sotrage of less than 5GB.
FolderMount allows for moving App data/obb to a USB device. Remaining components of the App, which sometimes are the larger part of the app, can't be transfered using
These remaining components can be 100s of MB and even above 1GB (Sine Mora is 292MB, Walking Dead is 1.14GB)
Solution
Link2SD allows for moving these components to an external SD card in the phone world. Below I'll describe how to do this on the Amazon Fire TV with a USB device.
This post heavily relies on tweaking a post by sashavasko. Major kudos to him. Up to finding his post I was not successful in mounting in a way that Link2SD could see the mount. This was due to a change in Android 4.2+ where one App's mounting isn't seen by others.
Below is a step by step guide for running this. I've posted a script for automating this here : http://forum.xda-developers.com/showpost.php?p=54601505&postcount=33
Requirements: Root, Mouse, Terminal Application
Step 0 - Preparations : Format a USB device to the Ext4 File system and install Link2SD
Ext4
Link2SD refers to parititoning your SDcard to both Ext4 and FAT, this is not required on our USB device. All we need is an Ext4 partiton we can mount for Link2SD.
I had a high end USB device I used for FolderMount. For testing, I got a 16GB Lexar Jump Drive, which got decent reviews. $8 at Staples ( even less with the right coupon. Other sizes are also cheap). Both went into my Powered USB hub.
You can also partition a single FAT32 USB device to two partitons - FAT32 and Ext4. I have verified both options. Please note that for this second option, if you already have files on your FAT32 USB device, you'd have to first copy them to a backup, as the partitioning trashes your data. You will then need to restore the backed up files to the FAT partition.
Format/Partition your USB device to Ext4 using free MiniTool Partition Wizard Home Edition on your Desktop/Laptop. Below is a nice post on this (Refer only to step 1), you can find others. Please note that this refers to an SDCard. We will be doing this on a USB device.
http://forum.xda-developers.com/showpost.php?p=37405779&postcount=1
In partitioning, please verify the partitions are created as Primary. Also, not sure is this is required, but I didn't name my partitions.
There are also linux commands to do this - I didn't investigate these.
Stick the Ext4 partitoned USB device into your Amazon Fire TV and power it up. We will need the device in for Step 2.
Link2SD
Download Link2SD from the Google Play store, or sideload it
Make the directory Link2SD requires
Code:
su
mkdir /data/sdext2
exit
Step 1 - Fix adb localhost
Follow step 1 in sashavasko's post
http://forum.xda-developers.com/showpost.php?p=45102645&postcount=1
Note1:
You will need a terminal app for this
Note2:
This step should only be run once. Running multiple times can mess the /data/misc/adb/adb_keys file as the key values will concatenate with sashavasko's method. This will cause mounting at boot not to work. If you did this or not sure if you've done this, just erase the duplicate keys from the /data/misc/adb/adb_keys file (the end of a single key is "[email protected] ). Or, better yet, if you aren't seeing any other different keys there - simply su and copy /sdcard/.android/adbkey.pub onto this file.
Step 2 - Install scripts
Follow step 2 in sashavasko's post
http://forum.xda-developers.com/showpost.php?p=45102645&postcount=1
Note 1
Look for your Ext4 partitoned device after running:
Code:
adb shell cat /proc/partitions
You should find the Ext4 device under /device/block starting with sd.
For example: My first USB device is sda1, the Ext4 partitoned one was sdb1 (sdb2 when the Lexar drive was partitoned to FAT32 and Ext4).
You should be able to recognize the devices according to their partition sizes.
Note 2
The msd2.sh file should be changed to be:
Code:
#!/system/bin/sh
mount -t ext4 [COLOR="Purple"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR][COLOR="purple"] /data/sdext2 [/COLOR]&& sleep 5 && /system/bin/vold
where the sdb1 device should be replaced by the device you located in Note 1.
Step 3 - Test the script and grant su permissions
Run this (no su command required, no path to the sd.sh file is required)
Code:
sd.sh
Verify you aren't seeing any errors. You will be granting SU permissions.
Run Link2SD. Go to the menu at the top right. Select "Storage Info" - Verify Link2SD recognizes the Ext4 partiton in the third line (under SD Card 2nd Part. ).
Step 4 - Auto Mount at initialization
For this I'm using the /system/etc/install-recovery.sh script which you should already have. This script loads at boot and calls /system/etc/install-recovery-2.sh (a non existent file).
Create a file at /sdcard/install-recovery-2.sh which contains
Code:
#!/system/bin/sh
/system/xbin/sd.sh
Now move the file to its place:
Code:
su
mount -o rw,remount /system
cp /sdcard/install-recovery-2.sh /system/etc/
chmod 755 /system/etc/install-recovery-2.sh
mount -o ro,remount /system
exit
Now Reboot (Long press remote Select + Play)
Step 5 - Link2SD ready to go
Open Link2SD to verify (as you verified before) that after boot Link2SD sees the Ext4 partiton.
Start moving files using Link2SD :
Select an App
Go to "Create Link" - You will be asked which file types to move. Check them all (not the paid option if you haven't paid).
Link2SD will show "Creating Link...", then an advert (in the non payed version) and then: Application files linked and moved to SD card
Note the expected storage change in the Amazon Fire TV's "About" menu option will be seen after Rebooting.
"Remove Link" works properly
"Move to SD card" is not relevant
Final Words
Don't use this to move system apps, or system-like apps
Responsibly for running this is solely on you. I am only describing what works for me.
Works great thanks
I'd love to see a standalone app for installing this.
Sent from my SM-N900V using XDA Premium 4 mobile app
The msd2.sh file mentioned in Step2/Note2 is used to create a fake external SD Ext4 partition for Link2SD.
You can also use it to create a fake external SD FAT partition at /storage/sdcard1 for FolderMount.
FolderMount automatically recognizes this partition and suggests this as the initial path for its destination path suggestion.
In my case - sda1 is the FAT partition (For me - a USB stick fully formatted to FAT32), and sdb1 is the ext4 formatted USB stick. The same should work with a single partitioned USB stick (but different sd* device names - see original post).
The updated msd2.sh file looks like:
Code:
#!/system/bin/sh
[COLOR="DarkGreen"]mount -t vfat /dev/block/[COLOR="Red"]sda1[/COLOR] /storage/sdcard1[/COLOR] && mount -t ext4 [COLOR="Magenta"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR] [COLOR="Magenta"]/data/sdext2[/COLOR] && sleep 5 && /system/bin/vold
SaltyCookie_OnLoan2FM_SVE said:
The msd2.sh file mentioned in Step2/Note2 is used to create a fake external SD Ext4 partition for Link2SD.
You can also use it to create a fake external SD FAT partition at /storage/sdcard1 for FolderMount.
FolderMount automatically recognizes this partition and suggests this as the initial path for its destination path suggestion.
In my case - sda1 is the FAT partition (For me - a USB stick fully formatted to FAT32), and sdb1 is the ext4 formatted USB stick. The same should work with a single partitioned USB stick (but different sd* device names - see original post).
The updated msd2.sh file looks like:
Code:
#!/system/bin/sh
[COLOR="DarkGreen"]mount -t vfat /dev/block/[COLOR="Red"]sda1[/COLOR] /storage/sdcard1[/COLOR] && mount -t ext4 [COLOR="Magenta"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR] [COLOR="Magenta"]/data/sdext2[/COLOR] && sleep 5 && /system/bin/vold
Click to expand...
Click to collapse
The one annoying thing about this is during boot it will read the entire partition. This in turn in my case makes booting the Fire TV really slow. Lets hope I dont have to reboot much because it now takes around 2-3 minutes to boot up.
MadFlava said:
I'd love to see a standalone app for installing this.
Sent from my SM-N900V using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I 2nd this. This is as close as we're gonna get to downloading Apps, ets., straight to an attached external drive but I know enough about this stuff to be somewhat intimidated by the initial instructions. Not that they're not clear, it just looks like I'd have too many avenues to brick my box.
Still...very good work OP. Thanks again.
MarkBP said:
I 2nd this. This is as close as we're gonna get to downloading Apps, ets., straight to an attached external drive but I know enough about this stuff to be somewhat intimidated by the initial instructions. Not that they're not clear, it just looks like I'd have too many avenues to brick my box.
Still...very good work OP. Thanks again.
Click to expand...
Click to collapse
Come on guys, this is XDA developers
OK, I have this brewing. Should post it by tomorrow.
awesome. how easy is it to reverse this entire process? I'd really like to know the risks before I take the plunge
I think the process can be greatly simplified. On my computer I created install-recovery-2.sh with the two lines below:
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
Then I connected via adb to the fireTV from my computer.
Then an adb push of install-recovery-2.sh to /sdcard and then did an adb shell to the fireTV from my computer and su once there.
Copied from install-recovery-2.sh from /sdcard to /system/etc
Did a chmod 755 on the file to make it executable and then rebooted and all seems to be working well with partitions recognized.
tselling said:
I think the process can be greatly simplified. On my computer I created install-recovery-2.sh with the two lines below:
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
Then I connected via adb to the fireTV from my computer.
Then an adb push of install-recovery-2.sh to /sdcard and then did an adb shell to the fireTV from my computer and su once there.
Copied from install-recovery-2.sh from /sdcard to /system/etc
Did a chmod 755 on the file to make it executable and then rebooted and all seems to be working well with partitions recognized.
Click to expand...
Click to collapse
Just tried this, didn't work for me (mount not detected).
- tselling, is Link2sd working with this ?
- If someone is working succesfully with Link2sd using tselling's method please report back. This is indeed a shorter route.
failed for me for tselling method
SaltyCookie_OnLoan2FM_SVE said:
Just tried this, didn't work for me (mount not detected).
- tselling, is Link2sd working with this ?
- If someone is working succesfully with Link2sd using tselling's method please report back. This is indeed a shorter route.
Click to expand...
Click to collapse
Link2sd found ok and I linked sevzero without problems. Should note that I use sda1 and sda2 for fat32 in first primary partition and ext4 on second primary pzrtition of same usb flash drive. Any other setup would need to have different script to match your drive setup.
Sent from my SAMSUNG-SGH-I497 using Tapatalk
why does this need more than 1 partition to work anyways? Is it just because the app requires it for some weird reason?
edit: also which partition needs to be the bigger one? do the sizes matter? and does stickmount need to be disabled for this to work?
desc
meadtj said:
why does this need more than 1 partition to work anyways? Is it just because the app requires it for some weird reason?
edit: also which partition needs to be the bigger one? do the sizes matter? and does stickmount need to be disabled for this to work?
Click to expand...
Click to collapse
why does this need more than 1 partition to work anyways? - Link2sd description in play store:
What you need for linking apps:
● root permission.
● a second partition on your SD card.
You should have two partitions on SD card and both should be primary.
The first FAT partition is your standard SD card storage. The second partition is used for application files and can be ext2, ext3, ext4, f2fs or FAT.
You need to use a non-FAT file system (ext2, ext3, ext4 or f2fs) on your second partition in order to link app's private data files. Because the FAT file system (FAT16, FAT32 or exFAT) does not support UNIX file ownership or permissions and will cause a security breakdown of app's private files.
Link2SD Plus can move app's private data files if you have a non-FAT partition
Click to expand...
Click to collapse
So we may be able to use FAT (haven't tried it) but we will lose some moving capabilities.
From my testing - FolderMount does work with the ext4 partiton, so I need two partitions (or 2 usb sticks).
also which partition needs to be the bigger one? - No restriction. Allocate as per your decision and experience with storage costs of apps.
do the sizes matter? - Don't believe her. It does.
Sorry. Uncalled for. Apologies. Not personal. I just had to.
and does stickmount need to be disabled for this to work? - No, it doesn't
983
tselling said:
Link2sd found ok and I linked sevzero without problems. Should note that I use sda1 and sda2 for fat32 in first primary partition and ext4 on second primary pzrtition of same usb flash drive. Any other setup would need to have different script to match your drive setup.
Click to expand...
Click to collapse
Ok, let's try and minimize this. Could it be due to tselling using a single partitioned USB drive, while I'm using two drives ?
I need a report back from someone with a single USB drive who tried tselling's simpler approach. If it failed - Maybe tselling added something along that he wasn't aware of. If it passed - Maybe that's a requirement for the simpler approach.
In other news, the script to automate this is take slightly more than I thought, due to unix-android differences (I come from a unix background). That, and the fact that we may have a simpler solution is delaying me. Oh, also had to stay late at work yesterday, Oooh and the dog ate my laptop.
What about Foldermount?
What about FolderMount for Data and OBB files? Can I still use it with Link2SD on same card?
SaltyCookie_OnLoan2FM_SVE said:
Ok, let's try and minimize this. Could it be due to tselling using a single partitioned USB drive, while I'm using two drives ?
I need a report back from someone with a single USB drive who tried tselling's simpler approach. If it failed - Maybe tselling added something along that he wasn't aware of. If it passed - Maybe that's a requirement for the simpler approach.
In other news, the script to automate this is take slightly more than I thought, due to unix-android differences (I come from a unix background). That, and the fact that we may have a simpler solution is delaying me. Oh, also had to stay late at work yesterday, Oooh and the dog ate my laptop.
Click to expand...
Click to collapse
I think it has to do with the mount points. I have the ext4 partition mounted to /data/ext2 where I think link2sd looks. I think that you could use an entire usb stick with one partition as ext4 mounted to /data/ext2 but your script would change
FROM
##############################################################################################
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
#############################################################################################
TO
###################################################
#!/system/bin/sh
mount -t ext4 /dev/block/sda1 /data/sdext2 && /system/bin/vold
###################################################
However, I have not tried this. I may try this later today since I have a second fireTV and usb stick arriving today.
also, I am planning to use foldermount with the first fat32 partition I created, but I haven't gotten that far as I want to use the Pro version but need the play store loaded first.
OOPS, I did forget one part "mkdir /data/sdext2" (otherwise the mount fails).
tselling said:
I think it has to do with the mount points. I have the ext4 partition mounted to /data/ext2 where I think link2sd looks. I think that you could use an entire usb stick with one partition as ext4 mounted to /data/ext2 but your script would change
FROM
##############################################################################################
#!/system/bin/sh
mount -t vfat /dev/block/sda1 /storage/sdcard1 && mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
#############################################################################################
TO
###################################################
#!/system/bin/sh
mount -t ext4 /dev/block/sda1 /data/sdext2 && /system/bin/vold
###################################################
However, I have not tried this. I may try this later today since I have a second fireTV and usb stick arriving today.
also, I am planning to use foldermount with the first fat32 partition I created, but I haven't gotten that far as I want to use the Pro version but need the play store loaded first.
Click to expand...
Click to collapse
tselling said:
OOPS, I did forget one part "mkdir /data/ext2" (otherwise the mount fails).
Click to expand...
Click to collapse
i did that too but still didnt work, maybe bc i have 3 partitions. Fat then Ext2 then NTFS
meadtj said:
i did that too but still didnt work, maybe bc i have 3 partitions. Fat then Ext2 then NTFS
Click to expand...
Click to collapse
Sorry, the directory is /data/sdext2
Your mount command is:
mount -t ext4 /dev/block/sda2 /data/sdext2 && /system/bin/vold
Also I am not 100% sure that ext2 filesystem works. ext4 works for sure.

[Q] Is it possible to mount different partition types?

I've been searching through various forums, but I cannot find any answers. I'm hoping someone can just lay it out straight or help me out. Is it possible to mount any other MicroSD partition types besides F32? I keep getting trolled by the file size limit when I'm transferring movies and some of the things out there to get ext4 formatted and mounted are not working for me. Am I limited by what development currently has available or does another partition type actually work and I missed it?
Edit: Forgot to mention - T230NU
DemisesAngel said:
I've been searching through various forums, but I cannot find any answers. I'm hoping someone can just lay it out straight or help me out. Is it possible to mount any other MicroSD partition types besides F32? I keep getting trolled by the file size limit when I'm transferring movies and some of the things out there to get ext4 formatted and mounted are not working for me. Am I limited by what development currently has available or does another partition type actually work and I missed it?
Edit: Forgot to mention - T230NU
Click to expand...
Click to collapse
yes,
create the directory you will mount in
mkdir -p /sdcard/toasty
then mount the partition, for this example an ext2 partition which correspond to the 2nd partition on your external sdcard
mount -o rw -t ext2 /dev/block/mmcblk1p2 /sdcard/toasty
you plan on using the partition/device normally so mount it read/write, -o rw
your stock kernel needs to support the filesystem type, in this case -t ext2
your stock kernel should support, ext2/3/4 vfat and exfat
ntfs likely requires you compile a custom kernel enabling ntfs support and maybe samba/cifs
wether or not you also need to assign extended attribute support or not, i don't know
you may also need to set selinux toggle support for permissive mode as well
mounting a non-sparse img works similarly
using peanut-butter.img as an ext4 image as the example image and super_yummy as the dir to mount to
mount -o rw -t ext4 /sdcard/peanut-butter.img /sdcard/super_yummy
m
moonbutt74 said:
yes,
create the directory you will mount in
mkdir -p /sdcard/toasty
then mount the partition, for this example an ext2 partition which correspond to the 2nd partition on your external sdcard
mount -o rw -t ext2 /dev/block/mmcblk1p2 /sdcard/toasty
you plan on using the partition/device normally so mount it read/write, -o rw
your stock kernel needs to support the filesystem type, in this case -t ext2
...
Click to expand...
Click to collapse
I have busybox installed and had to use "busybox mount..." to get it to mount. After typing "mount" I see it in the list, but using a file explorer to browse to that directory shows it as empty. I placed a few files in there to ensure I'd see it if it worked correctly, but nothing.
DemisesAngel said:
I have busybox installed and had to use "busybox mount..." to get it to mount. After typing "mount" I see it in the list, but using a file explorer to browse to that directory shows it as empty. I placed a few files in there to ensure I'd see it if it worked correctly, but nothing.
Click to expand...
Click to collapse
try total commander, the thing is kk perms and selinux make things a royal pain in the [BLEEP]
after you mount, ls the newly mounted partition and see if it's contents display correctly
so if you mounted blah-bity-blah-whatever to /hey/nah-nah then
ls /hey/nah-nah/
if things show up proper copy a file to /hey/nah-nah/ via terminal
cp /sdcard/shmoopy.txt /hey/nah-nah/shmoopy.txt
then ls /hey/nah-nah/ again to see if it showed,
i may have an older version of total commander lying around somewhere.
m
Wait a tick... My file shows in terminal, but not ES File Explorer?
DemisesAngel said:
Wait a tick... My file shows in terminal, but not ES File Explorer?
Click to expand...
Click to collapse
hmm okay try this, this is a version of my mount script for my debian chroot i run on my tab
note - replace god-awful silliness with actual names ! :silly:
place this script in xbin and run when needed
Code:
#!/system/bin/shell
busybox mount -o rw,remount /
busybox mount -t ext4 -o rw /dev/block/mmcblk1p2 /rooty-tooty
chmod 755 /rooty-tooty
try that, name the script whatever you want and make it executable after copying to xbin
chmod 755 /system/xbin/whatcha-ma-hoozit.sh
you may need to tinker with it a little and also adjust for correct filesystem
m
@DemisesAngel
TYPO- should be #!/system/bin/sh
moonbutt74 said:
hmm okay try this, this is a version of my mount script for my debian chroot i run on my tab
note - replace god-awful silliness with actual names ! :silly:
place this script in xbin and run when needed
Code:
#!/system/bin/shell
busybox mount -o rw,remount /
busybox mount -t ext4 -o rw /dev/block/mmcblk1p2 /rooty-tooty
chmod 755 /rooty-tooty
try that, name the script whatever you want and make it executable after copying to xbin
chmod 755 /system/xbin/whatcha-ma-hoozit.sh
you may need to tinker with it a little and also adjust for correct filesystem
m
@DemisesAngel
TYPO- should be #!/system/bin/sh
Click to expand...
Click to collapse
That didn't seem to help either. I've been looking over this thread, made some modifications, but I'm still unable to get it to mount correctly. I know I've got the right partition because I can see it from the output, but it still fails.
D,
hi,
Yep, i'm getting the same result, access via terminal, none by apk = most likely /system/etc/permissions/platform.xml
i don't see it being vold, were that the case, we wouldn't be able to access the mounted partition even by terminal.
Maybe by replicating internal storage mounting process, using fuse would work?
I'll try an experiment, does ES explorer have any advanced options for mounting storages or
just the same kid-glove android crap?
The last time this work correctly for me, i was running @starlightknight 's cm11 release for the sm-t530nu and it all
came together quite nicely, which is why i think platform.xml
m
you can mount system-wide with the debuggerd trick, but its sucks a little.
iam try to adapt vorcers mod.
D,
hi , if you are still having trouble you can try the approach outlined here
http://forum.xda-developers.com/showpost.php?p=61862920&postcount=33
sorry for the necromancy, just curious to see if it work for you.
m

Categories

Resources