Formatting microSD card with ext4 FS - Xiaomi Mi 8 Lite Questions & Answers

I have a 128GB microSD installed in this phone formatted for exFAT. I would like to format it for ext4. First, will the OS (Pixel Experience) recognize and mount it, and second, besides eliminating permissions issues, what other advantages (or disadvantages) would this give me? I only use Linux OS on my computers so reading the microSD as ext4 on my PC is not a problem.
For that matter, is there something better than ext4 I should consider?

Best to format as fat32 (default) for overall usability. You will find that almost no roms support ext4 file system on sdcards. I know Havoc OS does because I have a small 32gig ext4 partition on my sdcard. While most roms dont support ext4 on sdcard the bigger problem is that recoveries (twrp) don't support them. So no backups, no flashing roms, absolutely no access to your sdcard.
Really there is no reason to change the format of your sdcard. If you really want something besides fat32 then exfat is the only real option but again there can be issues where some roms and recoveries still wont support it.

cidxtc said:
Best to format as fat32 (default) for overall usability. You will find that almost no roms support ext4 file system on sdcards. I know Havoc OS does because I have a small 32gig ext4 partition on my sdcard. While most roms dont support ext4 on sdcard the bigger problem is that recoveries (twrp) don't support them. So no backups, no flashing roms, absolutely no access to your sdcard.
Really there is no reason to change the format of your sdcard. If you really want something besides fat32 then exfat is the only real option but again there can be issues where some roms and recoveries still wont support it.
Click to expand...
Click to collapse
Good to know. Thank you for the insight.

Related

NAND Backups and Ext

First, am I doing something wrong or does it just not work? I can't seem to get NAND +ext backup to work.
On the matter, of ext partitions there seem to be some ROMS that use ext2 and some that use ext3. Then there is also ext4. This can be annoying if you want to try another ROM that requires the ext type you don't currently have. I'd really rather not have to wipe the SD card and have to repartition it. Since I know I can use Acronis to format both ext2 and ext3, would it work OK to have FAT32, ext2, ext3, and swap all on the same SD card?
Also, I saw a post that seemed to say Froyo ROMs require just having one big FAT32 partition. That seems rather off to me since I thought Froyo ROMs could use A2SD.
gospodinwizard said:
First, am I doing something wrong or does it just not work? I can't seem to get NAND +ext backup to work.
On the matter, of ext partitions there seem to be some ROMS that use ext2 and some that use ext3. Then there is also ext4. This can be annoying if you want to try another ROM that requires the ext type you don't currently have. I'd really rather not have to wipe the SD card and have to repartition it. Since I know I can use Acronis to format both ext2 and ext3, would it work OK to have FAT32, ext2, ext3, and swap all on the same SD card?
Also, I saw a post that seemed to say Froyo ROMs require just having one big FAT32 partition. That seems rather off to me since I thought Froyo ROMs could use A2SD.
Click to expand...
Click to collapse
I'll refer you to the following link for making NAND + ext backups:
http://forum.xda-developers.com/showpost.php?p=6866495&postcount=1038
While I think it may be theoretically possible to have ext2, ext3, and swap, all on the same SD card, I seriously doubt any Android version would be able to recognize that form of partitioning (Froyo definitely wouldn't).
As for Froyo, the implementation of A2SD in Froyo simply stores apps in a folder on the SD card, thus eliminating the need for a partition. The A2SD implementation "hacked" into 2.1 ROMs on this website originated from Cyanogen, I believe. Therefore, there isn't specific Android OS support for the feature like there is from Google in 2.2.
That weird cause I have apps2sd working with almost 300mb of apps on my 512 ext partition, and when I do a regular NAND backup using clockworkmod recovery, and when I restore, it restores all of the apps on the ext. Don't know why this is tho or why your having trouble, just thought I'd let you know.
Sent from my Eris using XDA App

[Q] Format the Internal SD as ext4?

Hi, is there a way to format the Internal SD of a Vibrant as ext4?
I'm running Team Whiskey's Bionix-V 1.3.1. The Internal SD mounts as vfat.
The main reason for asking is because BeyondPod stops working every day or two because of a read issue on a podcast file. The recommendation is to do a reformat on the SD.
(can't post a link because I'm a new user)
My thinking is that if I have to reformat Internal SD anyway, I might as well make it ext4.
Thanks.
Doesn't work well
I tried doing this over the weekend. This worked poorly, I think because vold on Froyo can't see ext4.
I was able to mount the internal SD over USB to my Linux box. After copying the files off the vfat partition, I reformatted it as ext4 (using tools on the Linux box).
vold.conf and vold.fstab were modified not to try to mount /mnt/sdcard, as it wasn't able to see ext4 anyway. I put in a file in /etc/init.d to run the "mount" command for /dev/block/mmcblck0p1 to /mnt/sdcard so as to do the manual mount.
Permissions were an issue; the vfat mount was effectively mode 777, and I tried doing a chmod on the ext4 filesystem to the same effect.
Some apps started to work better, but, the original purpose of the exercise -- to get BeyondPod to work on ext4 -- did not work out. The operating system didn't seem to know that the SD was mounted; in Settings, the OS kept thinking that the SD wasn't mounted at all (it probably knows through vold) and apps such as BeyondPod probably takes its cue from that, rather than looking to see if its files are present at the expected mount point. I'm sure other applications will have similar issues.
After I realized that Froyo was not going to recognize ext4 through vold, I rolled back to vfat. I guess I just have to wait for a Gingerbread on the Vibrant (e.g., CM7 finalizes for the Vibrant, or the recent 2.3.3 for the international Galaxy gets into Team Whiskey's hands).

[Q] Clockworkmod and sd-ext

Just installed link2sd earlier (formatted partition as ext3). Wanted to flash a different rom. Trying to backup my phone, and clockworkmod tells me it can't mount sd-ext. Anyone know a reason and/or work around?
I think CWM works only with ext4 partition AFAIK. So, you can re-partition your sd card to a ext4 partition using CWM, or you can format the ext partition only to ext4 using a computer.
YouArePoop said:
Just installed link2sd earlier (formatted partition as ext3). Wanted to flash a different rom. Trying to backup my phone, and clockworkmod tells me it can't mount sd-ext. Anyone know a reason and/or work around?
Click to expand...
Click to collapse
which version of CWM have you got?
3.0.2.4, which I've used for a while now, always tries to back up my 6GB ext2 debian partition unless I remember to change cards first. no way I leave room in the vfat partition to back up that much data.
I'll put it up on 4shared if you want it.
mihir287 said:
I think CWM works only with ext4 partition AFAIK. So, you can re-partition your sd card to a ext4 partition using CWM, or you can format the ext partition only to ext4 using a computer.
Click to expand...
Click to collapse
Guess when I get home I'll copy the contents to computer, reformat, and copy back. Hopefully link2sd will notice the formatting has changed and reset itself
Sent from my LG-VM670 using XDA App
Doesn't work with extra either. Version 3.2.0.1 I believe it was.
Guess it doesn't really matter, can just use titanium since its all app stuff on there anyways...
Sent from my LG-VM670 using XDA App
i use CWM to back up my 512MB ext2 partition for my data2ext all the time (with the rest of the backup) and it seems to have no problem, and just to check i just mounted the partition in mounts and storage and it mounts fine. I know some recoveries ive used in the past on other phones would have problems with partitions that were not in 64-128-256-512-1024 MB, etc. format because of block size issue errors that i would get (when mounting or trying to set block size to 4096). I also found that when partitoning/formatting to ext2/3/4 some programs do not properly write the drive formatting and certain systems/recoveries/apps could not properly read them on the android. the best most consistent (android friendly) formats that i have gotten to date were in ubuntu (or any other) linux using "gparted". It seemed to always be the best and usually better than the format done by the phone recovery. Hope this helps. Sorry to drone on and on.
Partitioned originally with gparted. Have since resized to be 2048, and set its label to 'sd-ext'. Now instead of getting an error saying sd-ext might not be supported on my device, it just gives me a generic 'error mounting sd-ext'
I've had ext partition mounting problems before, I'm not sure if the cause is something to do with vold or what, but
after unmounting a sd card to exchange it with another one, it changes the device partitions in /dev/block like
/dev/block/mmcblk1p2
for the sd-ext partition instead of the normal
/dev/block/mmcblk0p2
you can see if this has happened by
Code:
ls /dev/block
in adb shell.
to mount it manually, if the numbering is off,
Code:
mount /dev/block/mmcblk1p2 /sd-ext
I've only had this happen with android running, but it might work in recovery too
Switched over to using data2ext. Mounts the 2nd partition as the /data partition instead of /sd-ext. Can manually mount 2nd as /sd-ext from within rom, but it doesn't carry over to recovery.
A possible solution... Create a symbolic link pointing /sd-ext to the 2nd partition? But then again, since /data now points to 2nd partition, is recovery picking up on that unknowingly and backing up the 2nd's contents when it thinks its backing up the normal /data?
I suppose I should investigate.
Edit: Yep it does backup the 2nd partition, thankfully. Just tried to install a theme made in UOT Kitchen, it borked some stuff, and the restore worked.

[Q] ext4 pain

First - I'll explain why I want this - my SD Card is a mess. So I decided to reorganize the entire folder structure using symlinks. Unfortunately no version of FAT doesn't support symlinks - so I decided to change the file system to either NTFS or ext4. I have basic Linux knowledge so I'm not able to change anything in the kernel, but because Gingerbread supports ext4, I have found a way to mount an ext4 sdcard. I basically change the default file system in vold.fstab (I replace "auto" with "ext4"). All seems to be working fine, but when I restart the phone I am unable to mount the sdcard again - I don't even get prompted by Android, it just doesn't detect my card. But whenever I dual-mount my card (using Root Toolbox) Windows detects my card (and reads it using Ext2Fsd). I know it probably has something to do with init scripts, but I haven't found anything about file systems in the any of the scripts in the init.d folder. I have found that the modified official Gingerbread kernel supports ext4 sd cards, but I want to know how to use the card with other kernels.
original vold.fstab:
Code:
dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.1/mmc_host/mmc0
modified version:
Code:
dev_mount sdcard /mnt/sdcard ext4 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.1/mmc_host/mmc0
I am using CyanogenMod 7.1 (Mik's version, beta 6.6.1), Franciscofranko's latest 2.6.35.14 kernel (16 august version) and Franko's tweaks if that is of any difference.
Well, sorry... but... eh.
State what you are after wrt "organizing" and someone can suggest a saner way to do it.
NTFS in R/W is only doable in a reasonable way with a FUSE-based driver, not the in-kernel one; ext4 or whatever other ext on the other way is a stupid idea when your computer uses Windows.
dr.notor said:
ext4 or whatever other ext on the other way is a stupid idea when your computer uses Windows.
Click to expand...
Click to collapse
I know that, but I'm using the card on the phone, not on my computer. And by the way, I have a full-featured Ubuntu Server (on VMware Workstation) for everything that Windows isn't able to do.
It isn't much of a cataclysm that I can't mount ext4, but I'm trying to understand why doesn't my method work.
Ianis G. Vasilev said:
It isn't much of a cataclysm that I can't mount ext4, but I'm trying to understand why doesn't my method work.
Click to expand...
Click to collapse
The stuff using vold.fstab assumes that the partition is FAT and not a random other filesystem.
The old vold supports vfat/ext2/ext3 filesystem, but the new vold only supports vfat filesystem. This is because Android frameworks does not support sdcard mounted on other filesystems. Even we can forcely mount an ext2/ext3 filesystem as the sdcard, it doesn't work well in some situations. So we decide to stop supporting them unless AOSP changes.
Click to expand...
Click to collapse
http://www.android-x86.org/documents/sdcardhowto
N.B. "Old" there means pre-Froyo
In case you insist that partitioning the SD card to ext? is the right way of "organizing", you need to mount that stuff via some initscript and be prepared for random stuff to break.
Thanks for the reply

[DEV][MOD][WIP][ABANDONED] Format SDCard as ext2 (instead of FAT32)

Idea abandoned. Reason - "The old vold supports vfat/ext2/ext3 filesystem, but the new vold only supports vfat filesystem. This is because Android frameworks does not support sdcard mounted on other filesystems. Even we can forcely mount an ext2/ext3 filesystem as the sdcard, it doesn't work well in some situations. So we decide to stop supporting them unless AOSP changes."
I was bored so I figured out in half an hour how to reformat the SDCard as ext2/3/4 instead of FAT32. From what I know, ext2 is much faster and more reliable than FAT32 but I still need to do some SDCard benchmarks to compare (e.g. in antuntu).
Current issues:
Vold in Turbo UI does not understand non-VFAT partition and won't mount it on startup (nor after UMS disable). Once you've setup the SDCard as ext2, you need to go to shell and run these commands to get SDCard mounted:
Code:
mount /dev/block/mmcblk0p1 /sdcard
vold
The first command mounts SDCard, the second seems to refresh vold and actually make the OS recognize that it's inserted. If you use an init.d script to mount sdcard like that first command, there is no need for vold (until you use UMS). This would not matter for ROM's in MTP mode.
Setting up SDCard as ext2:
Note that I chose ext2 as it is the most compatible/stable in Windows. More below.
(1) Backup the SDCard, obviously.
(2) Boot to recovery, unmount sdcard, go in to ADB shell
(3) Format first SDCard partition as Windows-compatible ext2 like so:
Code:
mke2fs -m 0 -I 128 -T ext2 /dev/block/mmcblk0p1
(4) (Windows users) Install "Ext2 IFS" from http://www.fs-driver.org (Yes, works on x64 Windows too).
- install with all defaults
- Check "assign drive letter automatically" when prompted with the Drive Letters screen
(5) Profit.
What's next?
While researching this, I found that CM9/CM10 Vold code was patched already to support ext4 filesystems. However this is ext2 so I am not sure it works. I would move to ext4, but there is no write-access driver or software for Windows that works reliably with ext4. Ext2 IFS however is widely regarded as very reliable these days.
I'll check it out more when I get some time and my Linux machine is finished (to compile a vold that supports ext2-4 and not just 4). But I'm making his thread now so other hackers can try it out, benchmark, or share ideas.
Cheers.
Grrr.... CM7 had ext fs support in vold and it was merged, but CyanogenMod rejected it in CM9 and CM10. Wtf?
Looks like I will have to edit vold sources and rebuild myself. But since I only do Jellybean work I don't know how to handle this....
...the only other alternative is that ext# SDCard has MTP as a requirement. Then I could have the SDCard mounted manually in kernel and vold would not complain. The SDCard is not unmounted in MTP transfer, so it would be usable - with the one exception of requiring a reboot if the user manually unmounts or removes the SDCard.
R: [DEV][MOD][WIP] Format SDCard as ext2 (instead of FAT32)
so it is possible to have the sdcard partition in ext? I have tried one year ago and if I remember correctly cm7 doesn't support it (or maybe it was a stock based rom, too much time passed ), but for people like me that use Windows veeeery rarely would be great, ext2 or ext3 are better than fat32 (ext4 for what I've seen is less reliable in this case)
Inviato dal mio Nexus 7 con Tapatalk 2
[email protected] said:
so it is possible to have the sdcard partition in ext? I have tried one year ago and if I remember correctly cm7 doesn't support it (or maybe it was a stock based rom, too much time passed ), but for people like me that use Windows veeeery rarely would be great, ext2 or ext3 are better than fat32 (ext4 for what I've seen is less reliable in this case)
Inviato dal mio Nexus 7 con Tapatalk 2
Click to expand...
Click to collapse
Yes, very possible. The instructions here all work well if the ROM has MTP mode. Because Vold cannot remount ext after UMS is enabled. So for Linux users with poor MTP support, that's still painful.....
My main concern right now is that ext2 seems to be more vulnerable to filesystem errors. Unlike FAT32, there is no quick/easy way to check if the filesystem needs repair. Not that I know of anyway.
So, I think I am going to abandon this. It might be why CyanogenMod rejected it.

Categories

Resources