[MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1/AOSP + Partitioned SD!

Search This thread

HMkX2

Senior Member
Jan 31, 2010
98
135
I just posted an updated version that works 100% on 4.2.2. Tested on Masta's 2/22 CM10.1 afternoonly.

This is the first time a script has automated the process AFAIK. Do some tests, people!
 

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

I've been out all day and just had a chance to work through your post. I went ahead and flashed the 4.0 zip. Rebooted into the OS. Powered off the phone. Inserted my exFAT SD card. Powered on. No card visible. Choosing Mount SD card results in the damaged SD card message.

Here's the debug report

[fuse-mountsd v4.0] exFat+NTFS autorepair and mount script (HMkX2 CORE//XDA)
Automated mounting and repair of alternate SD fs on GS3 CM10.1 [+AOSP Roms!]
BREAK! /dev/block/mmcblk1p1 is not a block-special file/device, did you enter it correctly?
Resetting ADB loopback connection/root security to PRIOR...
/system/xbin/fuse-mountsd.sh: [: -ne: missing second argument
 
  • Like
Reactions: HMkX2

HMkX2

Senior Member
Jan 31, 2010
98
135
[fuse-mountsd v4.0] exFat+NTFS autorepair and mount script (HMkX2 CORE//XDA)
Automated mounting and repair of alternate SD fs on GS3 CM10.1 [+AOSP Roms!]
BREAK! /dev/block/mmcblk1p1 is not a block-special file/device, did you enter it correctly?
Resetting ADB loopback connection/root security to PRIOR...
/system/xbin/fuse-mountsd.sh: [: -ne: missing second argument

Your block device isn't /dev/block/mmcblk1p1. That's the one thing I ask people to find out before using the script - it is the "physical location" of the card, and I can't find out what it is without probing randomly -- so I don't.

The instructions are listed in the first post. Take a FAT32 card, put it in, type "blkid", take it out, type "blkid", the one that goes away is your block device. Edit that into the top of the script.

The second error ([: -ne: missing second argument) is more concerning... it means my code isn't portable. I have a good idea what it is though. Try typing "setprop" , "getprop" and "getprop | grep persist.sys.root_access". Let me know if it says "command not found". Cyanogen has an setting for what (ADB, Programs, or Both) to give Root access to. Other ROMs may not have that.
 
Last edited:

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

Those instructions in the OP follow a sentence that says it should work on other ROMs/phones. Since I have the same phone as you I didn't think they applied to me. Sorry about that.

I don't have an extra SD card. I'll have to transfer all my data off this, format it, and do your instructions. I'll see if I can do that and the other commands you requested asap.

---------- Post added at 05:24 PM ---------- Previous post was at 05:20 PM ----------

None of those three commands resulted in command not found or anything like that. The setprop command requested parameters but the last two commands seem to function as I'd imagine they should.
 
  • Like
Reactions: HMkX2

HMkX2

Senior Member
Jan 31, 2010
98
135
Sorry for the trouble, but that is the safest way. I'm glad to hear the commands are portable. (I went through the code anyway -- that second error was nothing major, just trying to clear an already empty string. Maybe you never used root before on that ROM?)

I will add an automatic search for block devices in the next version to avoid this issue in the future.

Some people format their entire card (uses the whole disk, /dev/block/mmcblk1), other people partition it normally (1 big partition with MBR, /dev/block/mmcblk1p1), and other people have MULTIPLE partitions (those APP2SD people, or those doing the internal <-> external hack).​

Other ROMs/Phones may even use different names entirely! (/emmc, /dev/block/byname/______)

I am VERY hesitant to probe devices randomly... this mod is written to do ZERO damage to your system if something goes wrong, unlike CM10.1 (apparently), and that's how I'd like to keep it. But if it is difficult to use, what's the point?
 
Last edited:
  • Like
Reactions: spearoid

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

It's no problem at all. I want to struggle through this if it helps you iron anything out. I'm terribly excited someone actually considered this a project worth undertaking. I'm shocked at how little interest there seems to be in file formats other than fat32 on what is one of the best phones on the market.

I'll get the block info shortly. Sounds like there's only one step left for success!

---------- Post added at 06:06 PM ---------- Previous post was at 05:49 PM ----------

Sorry to be such a dunce but the first piece of info I see missing is what you list as the hard coded string of text already. But I do see other text that doesn't appear when running blkid after removing the SD card.

Also, I can't even find the file to edit in your zip file that is mentioned in the OP. I see mount.exfat-fuse but not exfat-mountsd.sh

Of course I'm just unzipping and looking in the xbin folder. That may be wrong.

Here are the two blkid results before and after removing the FAT32 card.

u0_a153@android:/ $ su
root@android:/ # blkid
/dev/block/mmcblk1p1: UUID="3C77-6D7A" TYPE="vfat"
/dev/block/dm-1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/dm-0: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/vold/179:97: UUID="3C77-6D7A" TYPE="vfat"
/dev/block/mmcblk0p17: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p16: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p15: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p14: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p11: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p1: UUID="00BC-614E" TYPE="vfat"
root@android:/ # blkid
/dev/block/dm-1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/dm-0: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p17: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p16: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p15: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p14: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p11: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p1: UUID="00BC-614E" TYPE="vfat"
root@android:/ #

---------- Post added at 06:28 PM ---------- Previous post was at 06:06 PM ----------

Actually after looking over the output more thoroughly I guess I don't see any other missing text in the second output other than mmcblk1p1
 
  • Like
Reactions: HMkX2

HMkX2

Senior Member
Jan 31, 2010
98
135
Sorry to be such a dunce but the first piece of info I see missing is what you list as the hard coded string of text already. But I do see other text that doesn't appear when running blkid after removing the SD card.

Also, I can't even find the file to edit in your zip file that is mentioned in the OP. I see mount.exfat-fuse but not exfat-mountsd.sh . Of course I'm just unzipping and looking in the xbin folder. That may be wrong.
Nobody is dunce, you just haven't learned everything yet. :) I changed name to fuse-mountsh.sh - my typo in the OP. (When I added EXT4/NTFS support it didn't make sense to call it exfat-mountsd anymore.)

I suggest editing it ON the device -- you don't need to flash the ZIP multiple times. Use "Rom Toolbox (Lite)" free program, click Explorer, navigate to "/system/xbin/" and open "fuse-mountsd.sh" in the builtin RB Text Editor. It's the first or second line.

u0_a153@android:/ $ su
root@android:/ # blkid
/dev/block/mmcblk1p1: UUID="3C77-6D7A" TYPE="vfat"
/dev/block/dm-1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/dm-0: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/vold/179:97: UUID="3C77-6D7A" TYPE="vfat"
/dev/block/mmcblk0p17: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p16: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p15: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p14: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p11: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p1: UUID="00BC-614E" TYPE="vfat"
root@android:/ # blkid
/dev/block/dm-1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/dm-0: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p17: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p16: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p15: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p14: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p11: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/block/mmcblk0p1: UUID="00BC-614E" TYPE="vfat"
root@android:/ #​
/dev/block/mmcblk1p1 is your block device. (vold is a mirror image.) Odd... this makes me wonder, what are you using to format your SD card to exFat?

I am now near 100% certain a wacky utility formatted your card as /dev/block/mmcblk1 -- no partitions (no p1). They are not supposed to do that, it's against standard! But good news for you, it means if you edit that line and delete two letters (p1) it should start working.

Blah. I'll edit the script to probe... against my better judgement.
 
Last edited:

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

Well this card came preformatted in exFAT. A Sandisk class 10 64 gb card. But your intuition is impressive. :). After the first few experiments with AOSP on this phone I thought it had borked my card. Formatted it to FAT32 and eventually went back to exFAT via Acronis Disk Director.

I've got ROM toolbox. I'll get on it.

---------- Post added at 06:42 PM ---------- Previous post was at 06:40 PM ----------

Though I think what I just wrote was wrong. I think I used disk director to format the card to FAT32. Windows 7 natively wants to format my card in exFAT and doesn't even provide a FAT32 option. So, actually I formatted through Windows native disk utility.

---------- Post added at 06:52 PM ---------- Previous post was at 06:42 PM ----------

Well, I opened the file in the editor and removed only the p1 that is in that first line of the script. Powered phone off. Inserted card (after running chkdsk /f) and still had an unmounted card upon rebooting...and got the Damaged SD card when pressing Mount SD.

I don't understand where you saw in that blkid output that I should remove the p1. But I trust you a lot more than me. :)
I'm thinking about using my wife's GS3 to format my card (on stock TouchWiz) and just reflashing your script.
 

HMkX2

Senior Member
Jan 31, 2010
98
135
If you reformatted the card, you no longer need to delete the p1!!! ;) This feels like Benny Hill. (You do not need my script for exFAT on TouchWiz, Samsung paid M$ for it!)

Do these in this exact order and I guarantee you will have a working card:
  1. Open Rom Toolbox. Edit the line to say "/dev/block/mmcblk1p1" and click the "Save" icon in the top right.
  2. Power off the phone. Eject the card.
  3. Stick the card in Windows. Open a command prompt and type "Chkdsk /f <your drive>"
  4. Stick the card back in the phone. Turn it on.
And the point is you can *eject* the card from System Volume Manager in Android, but to RE-MOUNT it and get rid of the error, you have to run the script! Clicking "Mount" will do nothing -- since the ROM handles that. You need to open a terminal and type "fuse-mountsd.sh <enter>".
 
Last edited:
  • Like
Reactions: spearoid

spearoid

Senior Member
Feb 21, 2009
763
166
If you reformatted the card, you no longer need to delete the p1!!! ;) This feels like Benny Hill. (You do not need my script for exFAT on TouchWiz, Samsung paid M$ for it!)

Do these in this exact order and I guarantee you will have a working card:
  1. Open Rom Toolbox. Edit the line to say "/dev/block/mmcblk1p1" and click the "Save" icon in the top right.
  2. Power off the phone. Eject the card.
  3. Stick the card in Windows. Open a command prompt and type "Chkdsk /f <your drive>"
  4. Stick the card back in the phone. Turn it on.
And the point is you can *eject* the card from System Volume Manager in Android, but to RE-MOUNT it and get rid of the error, you have to run the script! Clicking "Mount" will do nothing -- since the ROM handles that. You need to open a terminal and type "fuse-mountsd.sh <enter>".

This isn't Benny Hill. :) Thank goodness.
I HAD NOT reformatted the card yet when I made my last post. All I did was what you told me to do...opened the file from the xbin directory, edited it by removing p1, powered off phone, inserted card, powered on, same problem.

After making that post I did what I said I was going to do...and put the card in my wife's phone...in its "corrupt" state...let her phone format it....then put my phone in recovery, flashed your original zip again, rebooted, powered off, inserted card........and SUCCESS!!!!!

It is irrelevant now, but your step 1 instruction seem to tell me to edit the file to put it back how you had it in the first place. That's what it looked like before I edited anything. I removed the p1 because I thought you told me too :) and that didn't lead to success.

Bottom line is, it seems to work fine if you let the phone format the card instead of Windows.

Freaking excited now! Going to go try Directory Bind and symbolic links! Will post the results

And while I know something has gotten lost in translation and you have become convinced that I am in fact a dunce :p I know the whole Samsung licensing MS's exFAT thing, and AOSP having no native kernel support....that was the point of that thread you posted in that I started with the AOSP vs TW debate. I was simply using my wife's TW phone as a formatter, since it seemed you thought the problem might be how I had formatted my card to exFAT in Windows. :)

Thanks again for everything!
 
Last edited:

HMkX2

Senior Member
Jan 31, 2010
98
135
I'm glad it helped, and thank you for telling me that the phone formatting it fixed it! That helps a lot and makes it simpler for others to replicate. It was silly because this was the order:

Had stock "Sandisk" formatting (no partitions) <====> My script default was (partition 1)
Stuck it in the phone and didn't work :p

Reformatted FAT32 using Arconis (which saw the error and CREATED partition 1) <====> Showed /dev/block/mmcblk1p1 when you tested
Reformatted exFAT (partition 1) <=[:( same time! :(]==> Edited my script to GET RID of p1 (no partitions)
Stuck it in the phone and didn't work :p

Windows has always been bad about formatting and destroying partition tables -- anyone who has made a dual-boot Linux computer can verify that.

Rather than probe randomly, I am editing the script to try partitions in-order until it finds one it recognizes.
 
Last edited:

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

Yeah I thought about it afterwards that that might have hindered your troubleshooting process by just formatting it from the phone. We never actually found a resolution to the issue with the card formatted in Windows.

Maybe that just needs to be part of the OP instructions. "Make sure you've formatted the card from your phone or Linux, not Windows"

:)

Will report symbolic link test results shortly.
 

HMkX2

Senior Member
Jan 31, 2010
98
135
Maybe that just needs to be part of the OP instructions. "Make sure you've formatted the card from your phone or Linux, not Windows"
... but Linux doesn't support creating exFAT... yet. :laugh: :laugh: Maybe I'll just add /dev/block/mmcblk1 as a default option to expand coverage from the 70% of CM10.1 users to the 99% of regular users.

http://stackoverflow.com/questions/6537878/how-to-mount-a-exfat-partition-in-ubuntu-11-04
Note that this package doesn't (yet?) support formatting a new partition - you'll have to do that under Windows.
 
Last edited:

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

Oh. I barely mess with Linux. Just threw that I there in anticipation of a response from someone saying "or you could format it in Linux". :). Whoops!!
 

HMkX2

Senior Member
Jan 31, 2010
98
135
Posted an update in OP. Added a "Spearoid Procedure" to script v4.1 until I get a chance to code a more robust solution.

If you see a giant error flash on your screen yelling at you to partition your card correctly -- but the script still works -- remember to click "Thanks" by spearoid's name. :D
 
Last edited:
  • Like
Reactions: spearoid

spearoid

Senior Member
Feb 21, 2009
763
166
Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

Well that sounds special. :)

I just finished creating a symbolic link to redirect Google Music's files from the data\data folder to my exFAT SD card!! And I've successfully gotten Directory Bind to redirect game data like Gameloft's massive files to the SD card from the internal memory.

Absolutely fantastic! I really am shocked. Just two weeks ago I was resigned to never having anything but crappy fat32 on AOSP. Couldn't find anyone who seemed to think this would be possible. Then along comes our new scripting friend! I even posted several questions about it in certain AOSP ROM threads.

Your work is awesome and something that really needs to eventually get worked into AOSP ROMs if that doesn't create licensing problems.
I can't believe I tried Paragon and other apps and none of them worked. I was and still am totally willing to pay for this capability. I believe a donation is in order!
 

lordazoroth

Senior Member
Jul 21, 2012
176
80
Phoenix
Quick question, what happens if I flash the updated zip over my original which gave me exFAT. Would I be able to read NTFS afterwards and how would I go about updating safely?

I have 2 friends with the same phone and I'll be adding this functionality to theirs as well, just being careful.

thx, still working great on exFAT! :D
 

HMkX2

Senior Member
Jan 31, 2010
98
135
Quick question, what happens if I flash the updated zip over my original which gave me exFAT. Would I be able to read NTFS afterwards and how would I go about updating safely?
Just flash the zip. It handles everything and has the NTFS binaries included.

The update-script automatically removes "old" versions of my scripts and places the new ones in their place. It deletes the following extraneous files from the original release, since they don't work; if you actually want the exfat utils (even though they all fail saying "cannot get size"), you have to add them back in manually.
Code:
delete("/system/etc/init.d/50exfat-mountsd"); <- Replaced with  50fuse-mountsd
delete("/system/xbin/exfat-mountsd.sh"); <- Replaced with fuse-mountsd.sh

delete("/system/xbin/dumpexfat"); <- None of these work anyway
delete("/system/xbin/exfatlabel");
delete("/system/xbin/exfatfsck");
delete("/system/xbin/mkexfatfs");
 

HMkX2

Senior Member
Jan 31, 2010
98
135
Hi All, do you think i would be able to use this mod in conjunction with ExtSd2InternalSd that way i would be able use cm10 and and use my exfat 64gb sdxc as my internal card?
Looking at their script, I see no reason it should not work if you change some of the block devices around. (They used "/dev/block/vold/179:49" and "/dev/block/vold/179:17" for the Note2, which are inappropriate for the GS3.) From looking at it I can actually see a couple of problems with that script on a basic level. (For instance, they do no version checking and it is not coded for JB's per-user "/0/" storage.)

I will poke around this and make detailed instructions later. For now, I can just tell you the commands I'll use to figure it out. Type "cat /proc/partitions" and look for the mmcblk0p__ that is the size of your internal, or type "ls -al /dev/block/platform/msm_sdcc.1/by-name" to get the direct list -- look for an entry called "userdata".

Remember: exfat-fuse is still experimental at this point. Don't put your financial documents in there. (Ext4 and NTFS are stable as hell, though.)

Edit: No wonder it was coded so poorly! You linked the one for the wrong phone! You need to use his GS3 version (here)!! He didn't know how to make it AOSP compatible -- I'll work on this later, after I get my code more robust.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    August 4th 2013 - This script has not been maintained in a while. A big thank you to Captain_Throwback for providing continued support.

    This is now minimally supported.
    Now that CM is adding native NTFS/exfat support, the only thing my script handles is multiple partitions.

    July 21 2014 - Thank you n01ce! Please see n01ce's post for a "6.5 Alpha" that may solve some checksum problems with exFAT. I have changed devices, so this thread is for historical purposes/legacy support.


    "HELP! I accidentally made my exFat card unreadable!!" -- or-- "I can't see more than 1 partition in windows!!"

    Please read the instructions at the bottom of THIS POST HERE. No data will be lost!

    "My card was working up until a moment ago but now the phone is showing "card damaged!!"

    Re-run the script by typing "fuse-mountsd.sh" as root. The script will attempt to repair and re-mount.
    If that fails, run "chkdsk /f" in Windows. Do not reformat until it is the last resort!

    TL;DR: (Flash this), put exFat/FAT32/NTFS/EXT4 sdcard in, reboot.
    To remount, type "fuse-mountsd.sh" in a console (or) run using RomToolbox Lite (in /system/xbin/)
    Needs to be run every time card is ejected + reinserted -- including when UMS is used

    To unmount, type "fuse-mountsd.sh umount" (or if 1 partition) use Storage Manager

    Non-customized multi-partitions mounted in /storage/<their name>

    • Uses init.d to fix/mount at boot
    • Scans for/mounts all useable block devices (with safety checks)
    • User-specifiable dynamic mount points
      ~~Create a ".mounthere" file in the partition with the first line "/location/to/mount/at"
      ~~Use the first line "skip" or "SKIP" to bypass that partition
    • Rescans for media when you re-mount
    • Repairs typical exFat damage caused by CM10.1 (with safety nets)
    • FAT32 support
    • NTFS-3g support (noatime set to reduce wear)
    • EXT4/3/2 support (*fuse built into JB/CM10.1) <- (MTP+EXT4 permissions need to be set to media_rw:media:rw 775!!))
    • Cleans up after itself: disables/enables ADB/root-security to what you set


    BUGS:

    All -- ntfsfix does not work. Binaries need to be recompiled. Not a major issue only dead weight.
    exFAT may prevent deep-sleep. (NTFS on GS3 doesn't seem to have this issue.)

    If you use EXT4/3/2, you need to run the following commands to allow the card to be accessed by the mobile-user:

    Code:
    find  /storage/sdcard1/ -print0 | xargs -0 chown media_rw:media_rw
    chmod -R 775 /storage/sdcard1/
    
    (or)
    
    find  /storage/sdcard1/ -print0 | xargs -0 chown root:media_rw

    Other phones -- Post a debug.txt if it works for you.

    CM10 (4.1.x) -- Support is experimental. Use at your own risk.

    CM 10.1 (4.2.x) -- Implemented RSA Key Signing Fix, works with BOOTICE.exe partitioned cards.

    EXPERTS:

    Everything is softcoded thanks to the $SECONDARY_STORAGE, $ANDROID_DATA, $ANDROID_STORAGE, $ANDROID_CACHE env variables and get/setprop command. Some locations are hardcoded in the script's "analyzePhone" function as fallbacks.

    To custom-map mountpoints, create a ".mounthere" file in the root of each partition. "skip" or "SKIP" = ignore partition at mount, "/your/path/here" will use that path (or the default if bad). Defaults to "$ANDROID_STORAGE/device_id" if directory is invalid. Removes any temporary directories (in /storage/ only) at unmount. YOU HAVE TO CREATE ANY CUSTOM DIRECTORIES OUTSIDE "/storage" YOURSELF -- I set it like that as a security precaution.

    To disable "Directory Creation Security", edit the line at the top of the script to say "dirSECURITY=0". This script will remount / and /storage as RW if needed.​

    Here is a quick rundown of typical use-cases:

    You want one large (exFat/NTFS/ext4) partition:
    • No customization needed, just flash and go

    You want a small FAT32 partition (p1) at the beginning (for firmware/CWM/TWRP) with another big ext4 partition (p2) for your SD card mount. [ Your ROM's vold will mount (p1:fat32) as /storage/sdcard1 automatically. To get it to swap over: ]
    • Create a ".mounthere" file on (p2) "big" partition with the text "/storage/sdcard1"
    This will override Vold and mount the (p2) as external storage. The FAT32 partition will be mounted in /storage/mmcblk1. If you want to mount it elsewhere (even /data/media/0/extSD ! ) simply add another ".mounthere" on the FAT32 partition. (The directory must already exist -- you must make it beforehand -- or disable Directory Security feature.) Be warned - Vold will mount the first partition as /storage/sdcard1 any chance it gets -- even in the background -- unless there is something mounted there already (by this script).

    You have (1) partition for a game app you play (internal storage) that you want to rebind, (2) another part you want to rebind OVER an existing directory, and (3) your main storage.
    • Create a ".mounthere" on (1) with text "/location/of/your/game/app/data"
    • ".mounthere" on (2) with text "/folder/you/want/substituted"
    • ".mounthere" on (3) with text "/storage/sdcard1"

    You are a long-hair-hippie Linux developer with 4 partitions, each in a different filesystem, and want them mounted hidden from apps and listed by block device so you know what partition you are on:
    • No customization needed, just flash and go :D

    SUPPORT:

    I can only provide support if you supply me with logs. Do so by typing "fuse-mountsd.sh > /sdcard/debug.txt 2>&1" and opening the Debug.txt in your phone's storage.

    It's all automatic now - so if it mounts your modem as writeable and kicks your dog don't blame me. (It excludes dangerous block devices automatically [mmcblk0, /system, mtdblock, etc], but there is always a 1% chance it will miss something.) If it does, report it here so I can fix it.

    If you intend to use this with a other ROMs/phones, IT SHOULD STILL WORK. Post any errors or weird behavior.

    Code:
    Changelog
    
    [I]7.0 - TBA (Make GUI? Fix ext4 permissions automatically? Get paid?)[/I]
    
    6.4 - No longer uses "mount" output (wasn't acting standard-ly. Using /proc/mounts instead)
        - [COLOR="Red"]Got rid of conv=notrunc[/COLOR]. Be careful!
    6.3 - Bugfix to scrubMount code
    6.2 - No longer Experimental / final unstable
        - added rough ext2/3 support
    6.1 - mount command bugfix
    6.0 - Added a bypass for Directory Security, fixed some bugs.
    5.9 - Rewrote NOGO code from scratch -- UUIDs ignored
    5.8 - (??)
    5.7 - Support for Note2 formatted exFat cards + more (0xf4 bug)
    5.6 - bug fixed: no longer detects zram/assumes multimount
    5.5 - [COLOR="Red"]Experimental support for weird devices[/COLOR]
    5.4 - [b]Major bugfix!![/b] Fix fixmyexfat.sh coding fail
    5.3 - Fixed "vffat" support. Undid HARD QUIT on bad Nogo, made it a soft one.
    5.2 - Increased logging of tables, HARD QUIT if Nogo not found
    5.1 - Quick patch to fix dm-* device blacklist
    5.0 - [b]SUPPORTS MULTI-PARTITIONED CARDS! Autoscans for block devs! Complete rewrite![/b]
    4.1 - Quick patch to check mmcblk1
    4.0 - [B]WORKS 100% ON 4.2.2!![/B] My script is the first to achieve this AFAIK
    3.3 - fixed a bug detecting existing mounts (related to "non-persistent mount points" issue)
    3.1 - added dynamic exFAT repair code
    3.0 - added NTFS/ext4 support
    1.0 -> 2.0 <Removed>

    Attribution credits:
    Original thanks go to originator of the method, smitna in the Galaxy S2 forum. Additional thanks go to shardul_seth (Post 23) for compiling the latest version of the fuse-exfat and ntfs-3g binaries for ARM, and of course Andrew Nayenko for his efforts in creating GPL'd exFat code (fuse-exfat on google code).

    [HOWTO][exFAT][WORK IN PROGRESS] Mount exFAT formatted drives and cards - smitna
    Full NTFS Read Write support for Android (ARM) - shardul_seth
    [HOWTO][exFAT][CM10.1] Working 64GB ext sdcard with fuse-exfat (1.0.1) + FIX broken (my original Dev thread)


    I believe the term is I "kanged" their binaries. The rest is mine. This is a "mod"/"hack" until CM adds native support. (If ever: exFat)

    DONATIONS:
    https://supporters.eff.org/donate , or help a noob by linking to a solution in their thread. :good:
    https://plus.google.com/+CyanogenMod/posts/ib5wz8jk1JyOne of the CM Team has flesh eating bacteria! Keep CM alive! (Literally)
    4
    Finally,
    Here's my working implementation to build a static binary under bionic and recovery:
    https://github.com/PhilZ-cwm6/philz_touch_cwm6/commit/b1bbdc2608b5db5e6c400953da42ad68a42b1e09

    Here's a ready binary fully working. Enjoy the really smaller size of bionic
    http://d-h.st/eVo

    Please give your feedback
    4
    (..) I had a really quick question, I know it's somewhat unrelated but can the source files be used to give NTFS support to stock ROMs (non-aosp) and if so, how?
    Yes, entirely possible. Someone did it for EXT4 and it was merged. exFat they hesitated on for moral reasons, NTFS-3g they had no reason. However, their EXT4 version (was) buggy if you ejected/reinserted the card and mine wasn't. They might have fixed that though.

    (S3 International - i9300) (..) is it only flash this file (CM10.1-AOSP_fuse-mountsd_6.4_HMkX2.zip) after flash the rom??
    Yes. Install CM10.x, flash the ZIP in recovery. For most people that is all.

    (MediaTek based devices, both running AOSP ROMs. V987 is running Android 4.2.1 and V970 is running Android 4.1.1.) Both devices have init.d support, but after installing your zip files through recovery mode, the devices weren't able to properly mount the exfat formatted sdcard. While trying to mount it manually, I got the following output:

    Code:
    ~~~~~~~~~ Beginning FS Logic ~~~~~~~~~
    [COLOR="Red"]./fuse-mountsd.sh: line 940: local: can only be used in a function
    ./fuse-mountsd.sh: line 941: local: can only be used in a function[/COLOR]
    Index (0) - [/dev/block/mmcblk1p1\texfat\tmount.exfat-fuse\t-o rw,dirsync,noatime,umask=0\tfixmyexfat.sh]
    [COLOR="Red"]./fuse-mountsd.sh: line 952: [: too many arguments
    ./fuse-mountsd.sh: line 986: local: can only be used in a function
    ./fuse-mountsd.sh: line 987: local: can only be used in a function
    [/COLOR]
    (...)

    As I'm not yet familiarized with your script, do you have any idea of what's happening?
    Those errors in red mean your "shell prompt" is outdated and not liking the way my Bash script is written. You might need to use an updated version of BusyBox. Type "busybox --help" (I think) to find what version you have.

    (...)
    My only problem is transfer rate with MTP = very2 slow. 1-2MB/s
    What's strange is transfer using wifi = 3-4MB/s
    Transfer using card reader = 9-10MB/s

    some problem with MTP driver ?
    MTP sucks. That's a known fact. "SGS3 Easy UMS" app fixes that problem.

    so i must run a script in cm to use exfat and ntfs? is this righT?
    I made a ZIP which makes my script run by itself when the phone restarts. Technically you don't need to do anything more than flash it.

    @HMkX2

    Looks like CM is finally trying to enable exFAT support:

    http://review.cyanogenmod.org/45176

    How will that affect the usage of this script (once it's tested and merged)?
    Hooray! This complete hack of a mod won't be necessary anymore! :D

    (...)
    Ah, NTFS and exFAT support just got merged :)
    Hooray!

    That's not entirely true. The CM implementation doesn't allow for multiple partitions, which the script can/does account for. Since the necessary binaries are now included in CM, however, only the script is really needed now (and it may need to be slightly adjusted for the CM binary names).
    The CM implementation of EXT4 also sucks, the "sdcard" binary causes the phone to lock up since it doesn't terminate when you eject the card. Zombie processes.

    (..)
    When I put .mounthere file with "/storage/sdcard0/extSdCard" inside - it is not mounting. When I select another location (/storage/ExtSD for example) it works (it is mounting, but poweramp still does't shows this location)
    Disable "Directory Creation Security". There are instructions in the top post.

    Unless the directory already exists, my script is set to NEVER create one. It can bind on top of already-existing directories, however. This was a security feature meant to prevent newbies from making zombie folders everywhere.
    3
    I wouldn't say I'm a developer, just a scripter with a lot of time on her hands.

    My only question is: Even though this is written for CM10.1 on Verizon s3, might this also work on T-mobile s3 with an AOSP (Android 4.2.2) ROM?

    MAKE A NANDROID. This mod should do nothing permanently harmful anyway: it looks for EXFAT before writing anything.

    Carrier doesn't matter. It only depends (1) if your kernel has FUSE support, (2) if it has init.d support and (3) what your Block device is.

    1. I think Google added FUSE by default in JB, and anything based off CM10.1 will have it
    2. Type "echo $SECONDARY_STORAGE" in a terminal emulator. If it displays ANYTHING other than blank it should work.
    3. The Block device is trickier. Type "blkid" as root with with your FAT32 card in and out. The one that disappears is your Card's Block device, and should be /dev/block/mmcblk1p1.

    If you have any doubts, don't do it.
    3
    As you can see on the screemshot, there's no "Eject SD Card" option in Storage Manager. Also, a picture on /storage/sdcard1 doesn't show up in the Gallery. PowerAmp recognizes ordinary fat32 formatted ext card just fine, but not ntfs/exfat.
    (No Eject button: ) Weird.... very weird. Can you open a terminal as root and type "vold" and tell me what it says, or if that fixes it?

    (Not being recognized by apps: ) Can you try running an app like "SD Rescan" and tell me if that makes the contents visible?

    Creating /storage/sdcard0/extSdCard dir and then having internal storage mounted would mean that original /storage/sdcard0/extSdCard becomes unaccessable after internal storage is mounted.​
    Yes, that is normal behavior. Mounts go on top of existing mounts. Nothing you can do about that.

    P.S. I forgot to mention that `fuse-mountsd.sh umount` fails with `Device or resource busy` whenever I try to run it, the very same way `umount /storage/sdcard1` does.​
    Type "fuser -m /storage/sdcard1". Then "ps|grep <#'s listed one at a time>". That will tell you what is keeping its foot in the door and preventing the card from being unmounted. Even having a terminal open in that current directory is enough to prevent it.

    I seem to have similar issues, but I don't understand how the script could be the issue. (YouTube crash)
    I disabled autoscanning for media on boot. That was most likely what was causing it. It will now only autoscan for media when the script is run manually (6.0).

    ... my old device I9000...

    Well gave the 5.9 Experimental a run on the device, produced 3 logs - one with 4pcs ext4 partitions, second a log with no sdcard, third a log with the exfat sdcard from my camera.

    Results:

    R/W on exfat works :) real nice for posting photos on social services on the net - without the PC.:good:

    Same results as 5.8 ""tested a 4 partition sdcard all ext4 with different mountpoints - all four partitions mounts - but the mounts of directorys (3pcs) (/sdcard/somedirectory) does not mount as writeable only readable the last EXT4 partition (/storage/sdcard1)mounts as it should r/w .(the .mounthere works)""

    You are using the wrong location for .mounthere. "/storage/sdcard1" works, you said -- this is normal, and is where it normally looks.

    "/sdcard" is a link to a "fake vfat" filesystem.. The location of the EXT4 filesystem there is "/data/media/0/" or "/data/media", depending on your Android version. (This is MANDATORY -- if you use /sdcard/Download, when an app writes to it, it'll muck up the permissions as "u40_31" or something weird.)

    Code:
    ls -al /sdcard ==  sdcard -> /storage/emulated/legacy
    ls -al /storage/emulated/legacy == /storage/emulated/legacy -> /mnt/shell/emulated/0
    mount|grep emulated == /dev/fuse ([I]this is a "fake" vfat filesystem of /data/media)[/I]

    Furthermore, you are not setting the correct permissions. Type "ls -al /data/media/0/Download" (or /data/media/0/DCIM or /data/media/0/Android/data/com.spotify.mobile.android.ui/cache/Storage) and you will see "-rw-rw-rw-rw- root root <blah blah blah>".

    THIS IS BAD. You need to chown on everything to make it R/W, possibly chmod to make it executable. Run this command:

    Code:
    [B]find /data/media/0/Download -print0 | xargs -0 chown media_rw:media_rw[/B]
    [B]chmod 775 /data/media/0/Download[/B]
    or some combination thereof. (root:media_rw / root:sdcard_rw, ??)

    That will make it writeable. It is not a mount issue, it is a permissions issue.

    I had to comment out the safety check lines (below) before it would create/mount my .mounthere file, but I assume this is still intended to remain in place as a safety and I will have to comment this out on each script update?

    I made a change to 6.0 for you. At the top of the file, there is a single statement:

    Code:
    dirSECURITY=1

    Change that to "dirSECURTY=0" and it will do everything. ALSO, you DO NOT have to do that anymore if the folder you are creating is under "/storage/*" or whatever "$ANDROID_STORAGE" is. So if you had "/storage/mydirectory", it will work without having to disable directory security.

    I figure anything under /storage is fair game to mess with. Anything OUTSIDE of that, you have to create it yourself, OR disable 'directory security'.