Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,731,235 Members 51,639 Now Online
XDA Developers Android and Mobile Development Forum

[TouchWiz] Mount ext4 formatted SD cards on TouchWiz ROMs

Tip us?
 
Darkshado
Old
(Last edited by Darkshado; 2nd October 2013 at 09:14 PM.) Reason: Forgot to upload the file the first time around...
#1  
Darkshado's Avatar
Senior Member - OP
Thanks Meter 428
Posts: 958
Join Date: Apr 2011
Location: Montréal

 
DONATE TO ME
Default [TouchWiz] Mount ext4 formatted SD cards on TouchWiz ROMs

Hello everyone,

Background: Last January I wanted to mount an ext4 formated SD card, and it turned out to be a bit more difficult than just inserting it in my Note II. Back then, there was no exFAT support whatsoever in AOSP ROMs and I wanted to be able to run either TouchWiz or AOSP without having to reformat my card. FAT32 wasn't an option because of the 4GB limit.

I've since automated the methods that were devised in my previous thread (with due credit to @ttabbal), and since they should work on a variety of devices running TouchWiz ROMs, I thought it would be best to create a new thread in a more general location.

The usual caveats apply.

Required:
  • TouchWiz ROM
  • init.d support
  • a custom recovery that mounts ext4 SD cards properly, or a mounting updater-script. TWRP works out-of-the-box on my Note II.
You can get init.d support with the stock kernel on many devices by having the run-parts command launch from a custom install-recovery.sh script. See the following thread for files and a how-to:

[MOD]Term-init & Zip-init: Enable Init.d for Any Phones w/o Need of Custom Kernels!!!

SD card removal:

Should you need to remove the card it can be unmounted and safely removed from the storage settings as usual. Mounting it again requires either a reboot or manually executing the init.d script and then activating the card in the storage settings.

Technical considerations:

The mounting occurs early enough during the boot process that the media scanner and MTP services have no issues with this.

If your init.d support comes from the install-recovery.sh trick, CWM will prompt to delete the script before reboot. Don't.

If the mounting script doesn't run for some reason, or you try to activate the card before having mounted it manually, the phone will give an error and ask if you want to format the card. Don't.

Enjoy,

Darkshado
Attached Files
File Type: zip ext4_SD_mount_TW.zip - [Click for QR Code] (145.7 KB, 538 views)
My phones: Galaxy Note II SGH-T889V (with LTE enabled / ext4 SD card support on TouchWiz ROMs), Motorola XT-1045 Moto G LTE (TWRP)
Previous phones: Nexus S GT-I9020A, Galaxy Gio GT-S5660M (Arpeggiomod ROM / Discussion, stock rooted ROM), Motorola XT-1032 Moto G.
Phones for which I play "tech support" for family and friends: Galaxy Nexus GT-I9250, Galaxy Q SGH-T589R, Galaxy 551 GT-I5510M, LG C-800G Eclypse, Motorola XT-1032 Moto G
The Following 4 Users Say Thank You to Darkshado For This Useful Post: [ Click to Expand ]
 
SeaFargo
Old
#2  
SeaFargo's Avatar
Senior Member
Thanks Meter 30
Posts: 251
Join Date: Feb 2011
Location: Rome
Hello Darkshado, and thanks for your thread.

I have an S4 i9505 and I actually have a AOSP based MIUI operating system.
I have an external 16GB MicroSD EXT4 formatted with standard linux command.
I've to say that it works great, and the operating system just auto-mount that ext4 SD by itself..

Now I'm starting migrating from that very good but a little obsolete AOSP MIUI to a much more recent Samsung based version, wich is very complete and affrodable.

But ... this MIUI do not auto-mount my ext4 formatted external-sd.

It's strange because other OS, and other recovery also, do completely support external-sd ext4 filesystem.

MIUI says, from the notification bar, that the sd is not formatted and asks me if I want to procede with formatting.
I've obviously refuse that.

Do you have any suggests?

This MIUI is obviously a custom OS, and it sports 3.4.63-AbyssS4-1.6.1F Kernel.

Since this new MIUI is TW based I've tryed to run your script but without results.. Is there some other way to permanently auto-mount my ext4 external SD?

Kind regards.
Raf.

[Motorola Defy - Official MIUI Dev. Ed. - GWK74 - android-2.3.7_r1 - Holo Launcher]
[Samsung GT-I9505 Galaxy S4 - MIUI v5 - JDQ39E - android-4.2.2_r1.1 - 3.4.66-ChronicKernel - ext4 sdcard - Advanced Xperia Z Launcher 2.0.6]
[Testing the new i9505 MIUI official porting and ext4 sdcard]
 
SeaFargo
Old
#3  
SeaFargo's Avatar
Senior Member
Thanks Meter 30
Posts: 251
Join Date: Feb 2011
Location: Rome
Quote:
Originally Posted by Darkshado View Post
... it turned out to be a bit more difficult than just inserting it in my Note II.
I still find no way to auto-mount the ext4 sd to my Samsung based MIUI, and your scripts does not work on it ...

Can you or anybody help me?

Tnahk you in advance.

Kind regards.
Raf.

[Motorola Defy - Official MIUI Dev. Ed. - GWK74 - android-2.3.7_r1 - Holo Launcher]
[Samsung GT-I9505 Galaxy S4 - MIUI v5 - JDQ39E - android-4.2.2_r1.1 - 3.4.66-ChronicKernel - ext4 sdcard - Advanced Xperia Z Launcher 2.0.6]
[Testing the new i9505 MIUI official porting and ext4 sdcard]
 
SeaFargo
Old
#4  
SeaFargo's Avatar
Senior Member
Thanks Meter 30
Posts: 251
Join Date: Feb 2011
Location: Rome
Prompt How to solve the permission issue on MicroSD EXT4 filesystem?

I've find a way to partition and format MicroSD with EXT4 filesystem, and also to mount it properly under this MIUI, wich is a TW based environment.
Just to let you know, AOSP based MIUI is MicroSD EXT4 compatibile out-of-the-box.

Unfortunately, after mounting my ext4 MicroSD, I have permission issue (that I do not have on AOSP):
default chmod is 077, which means that files created by apps on the ext4 formatted SD card will only be readable by the same apps, unless you manually update permissions.

Do you have any suggestion to solve definitively this issue, different than change permission manually or in a batch mode?
I mean, I can not run a script (for batch update chmod) every time I just take a picture ...

My mounting script are:

Code:
#making sure adbd is on port 5555:
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
start adbd
#starting server in a way where proper private key is used:
HOME=/sdcard adb start-server
# connecting server to localhost
adb connect localhost
sleep 2
#actually mounting sdcard and re-running vold :
adb -s localhost:5555 shell su -c /system/xbin/msd2.sh
#if we don't kill server it will drain power like crazy:
adb kill-server
than
Code:
mount -t ext4 /dev/block/mmcblk1p1 /storage/extSdCard && sleep 5 && /system/bin/vold
Thank you in advance for your kind support.

Regards.
Raf.

[Motorola Defy - Official MIUI Dev. Ed. - GWK74 - android-2.3.7_r1 - Holo Launcher]
[Samsung GT-I9505 Galaxy S4 - MIUI v5 - JDQ39E - android-4.2.2_r1.1 - 3.4.66-ChronicKernel - ext4 sdcard - Advanced Xperia Z Launcher 2.0.6]
[Testing the new i9505 MIUI official porting and ext4 sdcard]
 
wassname
Old
(Last edited by wassname; 24th April 2014 at 11:27 PM.)
#5  
wassname's Avatar
Junior Member
Thanks Meter 1
Posts: 9
Join Date: Jun 2007
Location: Dodsland
Default one change

Great, this work for me with one change.

In /etc/init.d/10mountext4sd the line:
Code:
/system/bin/sdcard1 "$REALMNT" 1023 1023 &
Does not work, unless we change it to
Code:
/system/bin/sdcard1 "$REALMNT" /storage/sdcard1 1023 1023 &
Now it works and mounts the sdcard to /storage/sdcard1 nad /stroage/extSdCard

Changed zip attached
Attached Files
File Type: zip ext4_SD_mount_TWv2.zip - [Click for QR Code] (145.2 KB, 60 views)
The Following User Says Thank You to wassname For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes