Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,786,645 Members 38,857 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
alquimista
Old
#11  
alquimista's Avatar
Senior Member
Thanks Meter 107
Posts: 196
Join Date: Mar 2008
Default Yay!

Quote:
Originally Posted by HMkX2 View Post
Please check my post for the correct DD command - I typed /blk instead of /block due to habit.

I'm glad it works. As long as you don't re-plug the card while it is on, you will have no problems. If you accidentally DO "corrupt" the card, just "chkdsk /f" in Windows, turn the phone off, put the card in, and turn it on.

And the biggest help you can give would be those headers. (I was looking at the exfat.fsck-fuse code, apparently even THAT can't fix it!) For the time being, I will re-do the scripts to display more information so I can troubleshoot more easily.
Very interesting. I can go on the hunt for headers if you like. I have loads of sd cards.

Oddly enough, I switched to FAT32 even though I'm on a TouchWiz ROM, cause exFAT does not use alternating file allocation tables. When exFAT gets borked, it gets super borked and you have to use chkdsk (or some other brutish method) to retrieve files. When FAT32 gets borked, you can load the last table that was working and elegantly pull your files off the card (no need to muddle through a pile of chkdsk files and find the correct extensions).

Any possibility that this method could be used to mount a more robust file system like ext[2,3,4]? Journaling would be nice. Or some transaction safe file system.

Ta very much,
ALQI
PLEASE HIT THE THANKS BUTTON!!
I like to know when I've been a bit of help
The Following 2 Users Say Thank You to alquimista For This Useful Post: [ Click to Expand ]
 
miyu-hitori
Old
#12  
Senior Member
Thanks Meter 1
Posts: 176
Join Date: Mar 2008
Location: Shanghai

 
DONATE TO ME
Default Re: [MOD] Flashable exFAT support for CM10.1 / AOSP roms (external SD)

Great.I'll try it.

Sent from my SCH-I535 using xda premium
 
HMkX2
Old
(Last edited by HMkX2; 21st February 2013 at 06:00 PM.)
#13  
HMkX2's Avatar
Member - OP
Thanks Meter 127
Posts: 80
Join Date: Jan 2010
Quote:
Originally Posted by lordazoroth View Post
Sounds bad, I don't know why all these companies are sticking with Fat32 after all these years. Fat32 has been obsolete since like 2000, don't we have open source formats like ext4 now?
Why we have 15 competing standards... "Never attribute to malice that which is adequately explained by stupidity."
Btw, this file acts strangely on my device, I couldn't see it in windows explorer during plugin and It wouldn't copy to my sd card even though other files seem to be copying fine.
Any files you create on the device without "Rescanning for media" will not be visible in the MTP (Mass Tranfer Protocol) "MP3 player-like" abstracted FUSE filesystem. (One reason why people want UMS (USB Mass Storage) "hard drive-like" support, you see things immediately/it's faster.) Get a free program called SDrescan from Google Play, or run the command below(?), to update the MTP index and see files you create ON the device.
Code:
am broadcast -a android.intent.action.MEDIA_MOUNTED -d file://$SECONDARY_STORAGE
am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///storage/sdcard0
...let me know if you need anything else Quick question: If I shut the phone down and pull the SD, can I turn the phone back on and use it without the SD while I load the SD up with files, then power off, re-insert the SD and power on again? (like will it automount again?)
Yes, the mount script will simply fail and there will be a silent error. (I need to code some error checking if you insert a non-exfat card...)

Like I said, if you could intentionally re-corrupt the header by using Storage Manager to "Unmount SD" then "Mount SD", then the DD command, (and rescanning media to copy the file off!) I'd appreciate it. Although, I have a second idea of how to get around that problem in mind.....

Quote:
Originally Posted by alquimista View Post
Very interesting. I can go on the hunt for headers if you like. I have loads of sd cards.
Thanks but I think the bottom line is (1) there is no working open source exfat.fsck anyway and (2) headers are unique per-device. The proper fix is re-coding vold to not run fsck.msdos on a fsck.exfat card.
Oddly enough, I switched to FAT32 even though I'm on a TouchWiz ROM, cause exFAT does not use alternating file allocation tables. When exFAT gets borked, it getse that wa super borked and you have to use chkdsk (or some other brutish method) to retrieve files. When FAT32 gets borked, you can load the last tabls working and elegantly pull your files off the card (no need to muddle through a pile of chkdsk files and find the correct extensions).

Any possibility that this method could be used to mount a more robust file system like ext[2,3,4]? Journaling would be nice. Or some transaction safe file system.
Yep, that is all 100% true. But I've lost files on fat32 drives as well - and I'd hardly call multiple file tables elegant, especially when they become desynced. NTFS would be a better fix, except for the fact it is a magnetic-media filesystem with journaling/timestamps/excessive writes, and exFAT was designed for flash media in the first place!! Even EXT4 writes too much, EXT2 or EXT4 with journaling disabled is a better solution for integrity, but much worse for flash-life. Nowadays, the value of error-recovery outweighs the limited media life. (This discussion comes up a lot in custom Linux firmwares for routers: DD-WRT NVRAM/Flashdrives)

Shardul_seth, the gentleman that compiled these binaries, has made a package for full NTFS support already using ntfs-fuse3g. (<- link) NTFS-3g is very mature/stable at this point, and installation for our devices is even simpler since we already have FUSE support in the kernel. However, his scripts are to mount USB, not the SD card. Mine does the SD card - all those ADB workarounds - so absolutely could be adapted for mounting NTFS cards. I will work on that when I have some time -- I'd need to figure out how to identify a NTFS card on header alone.

Again, all these methods are HACKS, proper support should be added in the kernel at some point. Someone actually has, and I've been cheering for him. He added EXT4 support to CM10.1, his post and code are here. However, he says it "stalled in code review". For the time being, you have to do all this manually.
HMkX2 CORE F6BC 6626 F92A A8F6 72C3 5B4A A301 BF44 08B7 042D
The Following 2 Users Say Thank You to HMkX2 For This Useful Post: [ Click to Expand ]
 
lordazoroth
Old
(Last edited by lordazoroth; 22nd February 2013 at 01:50 PM.)
#14  
lordazoroth's Avatar
Senior Member
Thanks Meter 65
Posts: 176
Join Date: Jul 2012
Location: Phoenix
Quote:
Why we have 15 competing standards... "Never attribute to malice that which is adequately explained by stupidity."
Nice post lol, I only meant why FAT32 of all choices, these companies must know we're gonna be packing large files at some point, why knee cap us at 4gb when so many formats don't? Universal would be nice but of course it's entirely impractical :P

Quote:
Any files you create on the device without "Rescanning for media" will not be visible in the MTP (Mass Tranfer Protocol) "MP3 player-like" abstracted FUSE filesystem. (One reason why people want UMS (USB Mass Storage) "hard drive-like" support, you see things immediately/it's faster.) Get a free program called SDrescan from Google Play, or run the command below(?), to update the MTP index and see files you create ON the device.
Thanks for the media scan info, that'll help a lot, I'll try out your suggestions tonight

Quote:
Yes, the mount script will simply fail and there will be a silent error. (I need to code some error checking if you insert a non-exfat card...)

Like I said, if you could intentionally re-corrupt the header by using Storage Manager to "Unmount SD" then "Mount SD", then the DD command, (and rescanning media to copy the file off!) I'd appreciate it. Although, I have a second idea of how to get around that problem in mind.....
Will do, sounds interesting, will there be data loss or just header corruption? second idea in mind?

Also, each time I take the card out of my phone (properly after shutdown of phone) and place it in my computer (vista 64bit ultimate) It asks to check for errors, i'll click continue (confirmation to check), takes 3-5 seconds, finishes with no errors found. If I don't do this the card is write protected. I've made sure only to disconnect from PC after "safely removing hardware" so it appears that usage in the phone is generating the confusion. This doesn't seem to be an issue but I thought it might be worth mentioning
If I've helped you, please thank me.

My Device:
) T-Mobile Samsung Galaxy S5 G900T: BeansTown106 [kltetmo_UVU1ANCH_deodex] [04/16/14]

Last 2 Phones:
) T-Mobile Samsung Galaxy S III: Infamous v4.8.2 + KT747-TW-JB-4.1.2-ATT-05-31-2013 Kernel
) Sprint Nexus S 4G
 
boricua1213
Old
(Last edited by boricua1213; 22nd February 2013 at 06:42 PM.) Reason: Added question
#15  
Junior Member
Thanks Meter 0
Posts: 20
Join Date: Aug 2010
Default do you enter it correctly?

I get this when running the script:

Code:
BREAK! /dev/block/mmcblk1p1 is not a block-special file/device, do you enter it correctly?
How do I find what block file I need to change to script to?

Thanks for your work
 
HMkX2
Old
(Last edited by HMkX2; 22nd February 2013 at 09:31 PM.)
#16  
HMkX2's Avatar
Member - OP
Thanks Meter 127
Posts: 80
Join Date: Jan 2010
Quote:
Originally Posted by boricua1213 View Post
How do I find what block file I need to change to script to?
Safest (not easiest) way is to insert your FAT32 card, type "mount|grep vfat". The one you are looking for says "/dev/block/vold___:__" . (Shortcut: "mount|grep vold");

Then type "blkid". The one that's listed twice (UUID or Label) as "vold" is your block device's other name. (/mnt/block/mmc_somethingorother) Both names lead to the same spot.

(or)

Type "blkid" with your card in. Make a list. Remove your card. Type "blkid" again. The one that dissapears is your block device.
HMkX2 CORE F6BC 6626 F92A A8F6 72C3 5B4A A301 BF44 08B7 042D
 
lordazoroth
Old
#17  
lordazoroth's Avatar
Senior Member
Thanks Meter 65
Posts: 176
Join Date: Jul 2012
Location: Phoenix
Ok got the file, I created 2 files, 1 before and 1 after the force unplug, just in case.

Remember to rename the files without the .rar extension before use
Attached Files
File Type: rar working_sd_before.bin.rar - [Click for QR Code] (512 Bytes, 20 views)
File Type: rar working_sd_after.bin.rar - [Click for QR Code] (512 Bytes, 25 views)
If I've helped you, please thank me.

My Device:
) T-Mobile Samsung Galaxy S5 G900T: BeansTown106 [kltetmo_UVU1ANCH_deodex] [04/16/14]

Last 2 Phones:
) T-Mobile Samsung Galaxy S III: Infamous v4.8.2 + KT747-TW-JB-4.1.2-ATT-05-31-2013 Kernel
) Sprint Nexus S 4G
 
spearoid
Old
#18  
spearoid's Avatar
Senior Member
Thanks Meter 151
Posts: 674
Join Date: Feb 2009
Default Re: [MOD] 1-Click Flashable exFAT + NTFS + EXT4 support for CM10.1 / AOSP (external S

I am about to embark on this journey and make another attempt at ditching TouchWiz. Does this script make it as if everything is normal as far as apps accessing the SD card go? I assume so, but I'm specifically wondering if I'll still be able to use Directory Bind and if I'll be able to create symbolic links to redirect Google Music to the external SD.

Getting ready to flash and try anyway but figured I'd ask to see if someone knows the answer all ready.
 
spearoid
Old
#19  
spearoid's Avatar
Senior Member
Thanks Meter 151
Posts: 674
Join Date: Feb 2009
I'll be the first to admit the problem is almost certainly user error on my part but I have been wholly unsuccessful with this mod. I have tried it on Carbon Rom and Paranoid Rom. I guess they both have FUSE support, I couldn't find any confirmation of that on the Rom threads....particularly Carbon.

I flashed the zip in the OP in CWM after installing both Roms clean. I tried installing the zip as soon as I installed the Rom and I tried installing it after doing a full boot up first. Ran the chkdks /f command probably 12 times after each successive failed attempt to get my 64 exFAT card recognized. Said Damaged SD no matter what I tried. I saw the post on Page 1 about deleting the fixmyfat file....tried that too and no go. That tip may no longer be relevant since you've updated the script.

Is there something I am missing? There are lots of posts in this thread about mount commands and adb, but it seems from the OP none of those things are supposed to be necessary.
 
HMkX2
Old
(Last edited by HMkX2; 23rd February 2013 at 05:21 PM.)
#20  
HMkX2's Avatar
Member - OP
Thanks Meter 127
Posts: 80
Join Date: Jan 2010
Quote:
Originally Posted by spearoid View Post
Does this script make it as if everything is normal as far as apps accessing the SD card go? I assume so, but I'm specifically wondering if I'll still be able to use Directory Bind and if I'll be able to create symbolic links to redirect Google Music to the external SD.
In short, it should. However, exFAT/FAT32 don't support permissions/softlinks like ext4 does. So if you use ext4, just remember to set permissions appropriately! When in doubt, set permissions to 755 root:sdcard_rw or root:media_rw on the external sd.
I have tried it on Carbon Rom and Paranoid Rom. I guess they both have FUSE support, I couldn't find any confirmation of that on the Rom threads....particularly Carbon
Type "mount | grep fuse" in console. If you see "fuse" listed anywhere in the text, you have it. Google added it to JellyBean.
I flashed the zip in the OP in CWM after installing both Roms clean. I tried installing the zip as soon as I installed the Rom and I tried installing it after doing a full boot up first. Ran the chkdks /f command probably 12 times after each successive failed attempt to get my 64 exFAT card recognized. Said Damaged SD no matter what I tried. I saw the post on Page 1 about deleting the fixmyfat file....tried that too and no go. That tip may no longer be relevant since you've updated the script.

Is there something I am missing? There are lots of posts in this thread about mount commands and adb, but it seems from the OP none of those things are supposed to be necessary.
Do me a favor... open a terminal, type "su", then type "fuse-mountsd.sh > /sdcard/debug.txt 2>&1" (no spaces in 2>&1). It will make a "debug.txt" file in the root of your internal storage. Paste the output here. I am 90% certain you have the wrong block device set. 9% certain it is the 4.2.2 ADB thing.

You do not need to delete "fixmyfat.sh" -- those instructions are very old. Was the phone *physically off* when you plugged the SDcard in? Ignore the mount commands/ADB - you should not have to deal with them if you only plug in/unplug the card when the phone is off.

I am nigh certain it has to do with 4.2.2 messing with ADB. Like I said, for now, put in a *working* sd card *before* the phone is turned on and you won't run into that issue.
HMkX2 CORE F6BC 6626 F92A A8F6 72C3 5B4A A301 BF44 08B7 042D

Tags
cm10.1, exfat, ext4, external card, ntfs
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes