[Tutorial/HOWTO] Convert Your External SD Card from FAT/exFAT to EXT4! (3 ways!)

Search This thread

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
Hello guys.

I was looking for a similar guide to link to my friend but didn't find anything, so I decided to write my own.
Personally I didn't find any good guide regarding partitioning from android itself, so I think it's also more unique guide because you can easily make your own partition layout without using PC at all.

Why I should use EXT4 instead of FAT/exFAT?
1. We're running Android, Android is based on Linux. EXT4 is native linux-proposed filesystem, while FAT/exFAT is not.
2. All our internal partitions (/efs /data /system /cache /preload) use ext4, natively.
3. CM has poor exfat support, while fat32 is not recommended for big file systems (over 2 GB) because it doesn't work well with them, thus microsoft implemented exfat.
4. EXT4 has better stability and performance, especially on Android devices, compared to exfat and fat.

When you should not use ext4 over fat/exfat?
- When you for whatever reason use your external sd card in windows environment physically. Android works in MTP mode, you'll use your ext4 external sd card the same way as you use internal one under windows. But if you for whatever reason puts your external sd card f.e. in usb adapter connected with windows then it won't work. So yeah, if you keep your external sd card in your phone then you're fine.

Expert Way (Requires fdisk/mke2fs utilities (busybox), works always):
1. Launch any terminal from Android environment (f.e. Android Terminal Emulator or adb shell through PC)
2. Make sure you have root (su command)
3. Make sure you have all required utilities. Type fdisk --help and mke2fs --help, both commands should print usage. If you get "command not found" then you don't have required utilities. Either install Busybox or CM-Based ROM with native busybox support (tested on ArchiDroid 2.X)
4. Unmount your external sd card (umount /storage/sdcard1)
5. Launch fdisk partitioning program on your external sd card (fdisk /dev/block/mmcblk1)
6. Destroy partition table (o), create new partition (n), make sure it's primary (p) and first one (1).
7. You can check if you're satisfied with your partition layout (p). When you're done exit and save changes (w)
8. Create ext4 filesystem on your partition (mke2fs -t ext4 /dev/block/mmcblk1p1)
9. Reboot

Android should automatically detect and mount external sd card in ext4 after reboot.

Here you can find a short movie which shows going through expert way recorded by me :cool:

Intermediate Way (Requires USB Adapter and some patience, should work like a charm):
1. You'd need USB Adapter or any device which can read micro sd cards on PC
2. Open any linux-supported partitioning program (f.e. partition magic, gparted, parted), it needs to support ext4.
3. Delete all partitions from your external SD Card (typically, one fat/exfat) and create one ext4 partition.
4. In case you'd also want hardswap create 2 partitions, one primary ext4 one and second primary swap one.

Newbie Way (Requires PhilZ Touch Recovery, may not work):
1. Launch PhilZ Touch Recovery
2. Select "Mounts & Storage" => "format /external_sd"
3. Select "ext4" as a filesystem
4. Please note that it can take some time. This way you should get running ext4 filesystem, but personally I didn't test this method, as I prefer more advanced ones ;).

This guide is more or less universal but I'm using sgs3 external sd card paths so I want to make sure nobody bricks other phones ;). Personally I suggest using expert way, as it's probably the easiest one.

Hit thanks if it helped, I hope it did :).
 
Last edited:

cba1986

Senior Member
Aug 8, 2010
2,409
621
Somewhere in Buenos Aires
@JustArchi thanks for the tutorial. Now for the sake of sdcard wearing. I would like to disable Journaling. How do you do that?

EDIT: also i noticed after formatting the externalsd card there is 3 GB occupied by nothing (?) This is normal?
 
Last edited:

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
@JustArchi thanks for the tutorial. Now for the sake of sdcard wearing. I would like to disable Journaling. How do you do that?

EDIT: also i noticed after formatting the externalsd card there is 3 GB occupied by nothing (?) This is normal?

tune2fs -O ^has_journal /dev/block/mmcblk1p1 should do the trick. You can put it in init.d if needed.

Also no, you should get full size of your sdcard. Are you sure that you've firstly destroyed partition table (o) and then created new full-size partition (n), as showed in the video?

You can use fdisk also to get information about your external sd card and find why is it smaller than it should be.
 
  • Like
Reactions: cba1986

golti

Member
Oct 16, 2010
18
3
Abu Dhabi
HI, My 64gb is two partitioned one hardswap and other primary.
Will I lose data on both partitions if I delete partition and format to EXT4?
 

gfreeman86

Senior Member
Apr 15, 2010
74
20
HI, My 64gb is two partitioned one hardswap and other primary.
Will I lose data on both partitions if I delete partition and format to EXT4?

You will lose data contained in the partition you are formatting. If you leave the other partitions untouched, you won't lose their data.
 

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
HI, My 64gb is two partitioned one hardswap and other primary.
Will I lose data on both partitions if I delete partition and format to EXT4?

Just don't use (o), as it will destroy everything. Use an option to delete selected partitions (d, if I remember correctly) and create them through n.
 

vazio

New member
Feb 4, 2012
4
0
System Data

Hi, thanks for te help, but now a have a 1 gb lost by system data or 0.8gb if i disable the journaling, that is right??? Thanks
 

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
Hi, thanks for te help, but now a have a 1 gb lost by system data or 0.8gb if i disable the journaling, that is right??? Thanks

It depends on your rom and also if you created ext4 properly. I've formatted my 2 GB SD Card to EXT4 and I got 1,80 GB free (yes with journaling). This is because 5%-10% is reserved for "super blocks". Read more -> http://en.wikipedia.org/wiki/Ext4
 

Hottot2

Member
Jan 16, 2013
10
2
peterborough
problem using expert method

Hi Guys,

I am new fairly new to rooting and using terminal emulators.

I have a rooted samsung galaxy note 2 with superSU, busybox and shell terminal emulator. I verified fdisk and mke2fs
(fdisk --help and mke2fs --help) but then when I tried the command
"umount /storage/extSdCard"
I get the error message "Operation not permitted"

Can anyone tell me why this might be?



Thanks

/storage/extSdCard is the path to the external sdcard on my device.
 

Attachments

  • Screenshot_2014-01-13-12-17-41.png
    Screenshot_2014-01-13-12-17-41.png
    116.7 KB · Views: 782

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
Hi Guys,

I am new fairly new to rooting and using terminal emulators.

I have a rooted samsung galaxy note 2 with superSU, busybox and shell terminal emulator. I verified fdisk and mke2fs
(fdisk --help and mke2fs --help) but then when I tried the command
"umount /storage/extSdCard"
I get the error message "Operation not permitted"

Can anyone tell me why this might be?



Thanks

/storage/extSdCard is the path to the external sdcard on my device.

Did you login as root before? (su)
 
  • Like
Reactions: Hottot2

Hottot2

Member
Jan 16, 2013
10
2
peterborough
Did you login as root before? (su)

I did not.
However, I did try again and got the sane result. I used these commands in shell terminal emulator:

su -

mount

umount /storage/extSdCard

result: "Failed: Operation not permitted"

I have verified root with root checker...and after typing the command "su -" I was prompted by supersu to "allow"

I believe this issue will likely be something simple that I am not aware of.
I have tried this on my galaxy note 2 and my tab3 8.0 with the same results.

I really appreciate any help offered.
 
  • Like
Reactions: hearkenoath

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
I did not.
However, I did try again and got the sane result. I used these commands in shell terminal emulator:

su -

mount

umount /storage/extSdCard

result: "Failed: Operation not permitted"

I have verified root with root checker...and after typing the command "su -" I was prompted by supersu to "allow"

I believe this issue will likely be something simple that I am not aware of.
I have tried this on my galaxy note 2 and my tab3 8.0 with the same results.

I really appreciate any help offered.

Try to execute su -c "umount /storage/extSdCard"
It worked flawlessly in my case.
 

krha23

New member
Nov 27, 2010
2
0
Trowbridge/Pasłęk
Thanks Archi. I was wandering around looking for a solution to the problem with my sd(I'm nooo0b if it goes about Linux/Android :D). My Archidroid 2.3.3 did not recognized/mount my external card, so after following your instructions (using the terminal in android) now I can enjoy my 64gb sd card.. Great job!
 

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
Ok. That worked. Thanks.
I then tried (su -c "fdisk /dev/block/mmcblk1")
Then...press m for help...or pressing "o" gets me a syntax error.
I have attached a screenshot.

Thanks again
Ryan

Okay, you're user, not root. This is a weird android shell, that's why.

Try to use "su -i" to get root shell, then use fdisk (without su).
 

Hottot2

Member
Jan 16, 2013
10
2
peterborough
Okay, you're user, not root. This is a weird android shell, that's why.

Try to use "su -i" to get root shell, then use fdisk (without su).

Still didnt work. After typing "su -I" the next line still says "[email protected]:/$"

I was thinking I could try a reinstall of shell terminal emulator...or perhaps you could recommend a different one to use.

I will try again later tonight.

Thanks
Ryan
 

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
Still didnt work. After typing "su -I" the next line still says "[email protected]:/$"

I was thinking I could try a reinstall of shell terminal emulator...or perhaps you could recommend a different one to use.

I will try again later tonight.

Thanks
Ryan

Try android terminal emulator, you must gain root shell. Typically "su" command does that, "su -l" should as well.
 

Hottot2

Member
Jan 16, 2013
10
2
peterborough
Try android terminal emulator, you must gain root shell. Typically "su" command does that, "su -l" should as well.

Alright...typed su and gained root....got through ttothe last step.

I typed "mke2fs -t ext4 /dev/block/mmcblk1p1"

and the result was: "mke2fs: invalid option -- t"

I have trying to read about mke2fs and the -t option but no luck so far.

Thanks
Ryan
 

Tom-Tom07

Senior Member
Nov 12, 2013
82
56
Hello Archi and thanx for the tutorial :)

I followed all the steps, done it to the end, but after reboot I couldn't make any folder on SD card.

Card is recognized, formated as EXT4, but for some reason there is no way to put anything to it :(

Tried again with gparted, ended with same result.

Tried to change ownership, but that also didn't work out...

Now i reverted card to fat32...

Any idea what could be wrong?

btw, using NeatROM 4.4.2 with boeffla kernel and Philz 6.00.8

thanx in advance :)
 

JustArchi

Inactive Recognized Developer
Mar 7, 2013
8,740
38,809
Warsaw
Hello Archi and thanx for the tutorial :)

I followed all the steps, done it to the end, but after reboot I couldn't make any folder on SD card.

Card is recognized, formated as EXT4, but for some reason there is no way to put anything to it :(

Tried again with gparted, ended with same result.

Tried to change ownership, but that also didn't work out...

Now i reverted card to fat32...

Any idea what could be wrong?

btw, using NeatROM 4.4.2 with boeffla kernel and Philz 6.00.8

thanx in advance :)

Ext4 support is broken in your rom.

Alright...typed su and gained root....got through ttothe last step.

I typed "mke2fs -t ext4 /dev/block/mmcblk1p1"

and the result was: "mke2fs: invalid option -- t"

I have trying to read about mke2fs and the -t option but no luck so far.

Thanks
Ryan

Your rom doesn't support mke2fs properly.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 45
    Hello guys.

    I was looking for a similar guide to link to my friend but didn't find anything, so I decided to write my own.
    Personally I didn't find any good guide regarding partitioning from android itself, so I think it's also more unique guide because you can easily make your own partition layout without using PC at all.

    Why I should use EXT4 instead of FAT/exFAT?
    1. We're running Android, Android is based on Linux. EXT4 is native linux-proposed filesystem, while FAT/exFAT is not.
    2. All our internal partitions (/efs /data /system /cache /preload) use ext4, natively.
    3. CM has poor exfat support, while fat32 is not recommended for big file systems (over 2 GB) because it doesn't work well with them, thus microsoft implemented exfat.
    4. EXT4 has better stability and performance, especially on Android devices, compared to exfat and fat.

    When you should not use ext4 over fat/exfat?
    - When you for whatever reason use your external sd card in windows environment physically. Android works in MTP mode, you'll use your ext4 external sd card the same way as you use internal one under windows. But if you for whatever reason puts your external sd card f.e. in usb adapter connected with windows then it won't work. So yeah, if you keep your external sd card in your phone then you're fine.

    Expert Way (Requires fdisk/mke2fs utilities (busybox), works always):
    1. Launch any terminal from Android environment (f.e. Android Terminal Emulator or adb shell through PC)
    2. Make sure you have root (su command)
    3. Make sure you have all required utilities. Type fdisk --help and mke2fs --help, both commands should print usage. If you get "command not found" then you don't have required utilities. Either install Busybox or CM-Based ROM with native busybox support (tested on ArchiDroid 2.X)
    4. Unmount your external sd card (umount /storage/sdcard1)
    5. Launch fdisk partitioning program on your external sd card (fdisk /dev/block/mmcblk1)
    6. Destroy partition table (o), create new partition (n), make sure it's primary (p) and first one (1).
    7. You can check if you're satisfied with your partition layout (p). When you're done exit and save changes (w)
    8. Create ext4 filesystem on your partition (mke2fs -t ext4 /dev/block/mmcblk1p1)
    9. Reboot

    Android should automatically detect and mount external sd card in ext4 after reboot.

    Here you can find a short movie which shows going through expert way recorded by me :cool:

    Intermediate Way (Requires USB Adapter and some patience, should work like a charm):
    1. You'd need USB Adapter or any device which can read micro sd cards on PC
    2. Open any linux-supported partitioning program (f.e. partition magic, gparted, parted), it needs to support ext4.
    3. Delete all partitions from your external SD Card (typically, one fat/exfat) and create one ext4 partition.
    4. In case you'd also want hardswap create 2 partitions, one primary ext4 one and second primary swap one.

    Newbie Way (Requires PhilZ Touch Recovery, may not work):
    1. Launch PhilZ Touch Recovery
    2. Select "Mounts & Storage" => "format /external_sd"
    3. Select "ext4" as a filesystem
    4. Please note that it can take some time. This way you should get running ext4 filesystem, but personally I didn't test this method, as I prefer more advanced ones ;).

    This guide is more or less universal but I'm using sgs3 external sd card paths so I want to make sure nobody bricks other phones ;). Personally I suggest using expert way, as it's probably the easiest one.

    Hit thanks if it helped, I hope it did :).
    2
    Hello Archi and thanx for the tutorial :)

    I followed all the steps, done it to the end, but after reboot I couldn't make any folder on SD card.

    Card is recognized, formated as EXT4, but for some reason there is no way to put anything to it :(

    Tried again with gparted, ended with same result.

    Tried to change ownership, but that also didn't work out...

    Now i reverted card to fat32...

    Any idea what could be wrong?

    btw, using NeatROM 4.4.2 with boeffla kernel and Philz 6.00.8

    thanx in advance :)

    Ext4 support is broken in your rom.

    Alright...typed su and gained root....got through ttothe last step.

    I typed "mke2fs -t ext4 /dev/block/mmcblk1p1"

    and the result was: "mke2fs: invalid option -- t"

    I have trying to read about mke2fs and the -t option but no luck so far.

    Thanks
    Ryan

    Your rom doesn't support mke2fs properly.
    2
    ok... i changed forst storage/sdcard1 permussions with chmod..didnt work..and after that i chmod on /mnt/media_rw/sdcard1 and now i can write on sdcard1...

    shouldnt i have permissions at first hand? :S

    Sent from my GT-I9300 using xda app-developers app
    1
    @JustArchi thanks for the tutorial. Now for the sake of sdcard wearing. I would like to disable Journaling. How do you do that?

    EDIT: also i noticed after formatting the externalsd card there is 3 GB occupied by nothing (?) This is normal?

    tune2fs -O ^has_journal /dev/block/mmcblk1p1 should do the trick. You can put it in init.d if needed.

    Also no, you should get full size of your sdcard. Are you sure that you've firstly destroyed partition table (o) and then created new full-size partition (n), as showed in the video?

    You can use fdisk also to get information about your external sd card and find why is it smaller than it should be.
    1
    OK - please could you help me a little further - I'm now in recovery mode 'philz' and have the phone connected in adb 'adb devices' but when I type the first command 'fdisk --help' I get 'fdisk is not recognized as an internal or external command'

    I'm missing something really simple I'm sure??

    adb shell.