Mount f2fs sdcard on boot - Xiaomi Redmi 3 Questions & Answers

I have a 128 GB microsd and I do not want FAT32 on it. I have MIUI 8 (Android 5.1.1) with 3.10.49 kernel, TWRP 3 and root. For some reason mount doesn't work at all, it always produces error "Invalid argument". I tried replacing it with one from BusyBox but it didn't help. Some forum guys told me that I should add the card to fstab (which AFAIK is located inside boot.img), and edit the config of vold (which is located I have no idea where). Also this. All I understood from there is that there is some storage_list.xml and I should edit it. Again, searching through forums led me to this path framework-res.apk\res\xml\storage_list.xml.
But still! I have no idea where this framework-res.apk is located and how do I unpack-repack it.
All info that I'm desperately trying to extract from google is outdated or related purely to cyanogen >_< Please give some instructions

You wrote you don't want FAT32. Other filesystem than that isn't supported by MIUI which is why you won't succeed to show your card content by editing anything. You need a 3rd party libs with your filesystem support.
See here, worked for me http://forum.xda-developers.com/showthread.php?p=61142640
or install a custom app with your filesystem support (eg. Paragon NTFS).It works either.
Sent from my phone by Tapatalk

Dude, that's the f$#@ed up part, you see.
> If you use KitKat
And I'm using 5.1.1 which is technically lollipop.
I'm seeking for a support as close to native as it can be, so I'm not involving any "mounting" crapware, especially Paragon's products, I'm fed up with their ext4 4 windows driver which gave me countless BSODs and corrupted files.
You said that MIUI doesn't support anything but FAT32, but that's not 100% true. It by default supports only FAT32 for external storage. But at the same time it mounts internal storage (which is of course in ext4) no problem. So I guess it's not *unable* to use ext4 (or f2fs, which is AFAIK supported by any kernel after 3.10.*) for external storage, it's just not enabled by default, and the question is how do I properly use that ability of android to mount ext4 (and/or f2fs)
UPD: I have to apologize for posting "also this" in the initial post w/o actually giving the link, here it is.
This is what seems actually related, but I'm too noob to understand what am I supposed to do to mount the damn card

First, the ROM and/or (especially) kernel should have F2FS support, then ramdisk should be modified with fstab edited so it could mount F2FS partitions at boot.
Other than that, it's impossible.
Sent from my ASUS_Z00A using XDA Labs

Related

Is it possible? Use ext4 for sdcard?

Is it possible to repartition my SD card to use EXT4 instead of FAT32, with the Fascinate? I'm currently running an EB01 kernel and a custom EB01 build. I'm just not sure how to do this part, as I've never done it before. I've seen it done for other devices, but I don't think it has come up here yet. This isn't really a debate on if I should or should not make it EXT4, just on how to do it.
That's what a voodoo kernel does.
Sent from my SCH-I500 using Tapatalk
JoeDat said:
That's what a voodoo kernel does.
Sent from my SCH-I500 using Tapatalk
Click to expand...
Click to collapse
I'm running the EB01 voodoo kernel, and yes it obviously has support for EXT4 since that is the FS it uses.
My question though is how can I mount my SD card to be recognized when I format it to EXT4 too?
Ah crap. I should have read your post more than once. Mundane detail. Just call me Michael Bolton.
Sent from my SCH-I500 using Tapatalk
If you don't have anything on your SDcard you mind deleting (or could just back it up), you could always try repartitioning it, and then seeing if Android is able to mount it.
If it doesn't automatically work, it shouldn't be too hard to modify the system to work (either by switching it from using 'vfat' to 'auto' or 'ext4')... it's just a matter of finding out where to change it.
There's no reason why it wouldn't, I guess... worst case you use command line mount tool to mount it manually every boot
That's what I thought too, that it would work inherently, but I partitioned/formatted the entire thing to EXT3 and it was not able to be recognized. I think either A) there is no built-in module for EXT3 support, or B) I'm just not doing it right.
Could be that I used a Windows tools to do the job to get EXT3, and I'm having trouble finding one to do EXT4, and I can't find any tools/scripts to convert EXT3 to EXT4 for Android.
If you format the sdcard to anything other than FAT32, Windows will not be able to read it when you try to mount it on your PC. I'm not sure if there are any utilities available that allows Windows to directly mount EXT filesystems or not, but I would be very afraid of data loss with a configuration like that.
What is the reason you want to convert it? Is it the file size limit of FAT32, or something else?
Posted from my EB01 SuperClean Fascinate with Voodoo
ivorycruncher said:
If you format the sdcard to anything other than FAT32, Windows will not be able to read it when you try to mount it on your PC. I'm not sure if there are any utilities available that allows Windows to directly mount EXT filesystems or not, but I would be very afraid of data loss with a configuration like that.
Click to expand...
Click to collapse
There's been an ext2 (possibly 3/4, but all are backwards compatible long as you don't use extents on 4) driver for Windows for a number of years. There's also a number of tools that can allow you to open ext2/3/4 file systems and modify them, without actually having to mount them.
ADB would also still work, so would an app that provides access to the sdcard via webdav/ftp/sftp/etc.
What is the reason you want to convert it? Is it the file size limit of FAT32, or something else?
Click to expand...
Click to collapse
Speed should improve by quite a bit, as well as greatly increased reliability (although the windows. Ext2/3/4 also support far larger files than fat32, of course, so if you like your raw-DVD rips or 1080p ultra-high-quality bollywood movies, there would be an obvious benefit by removing that restriction. I don't believe the ext family of file systems support it (but I could be wrong about ext4), but tail packing would greatly improve efficiency if you have a massive number of small files (reiserfs has it, btrfs might also- not sure).
Personally, it doesn't seem like there's enough of a benefit to really do it, especially if you're not using Linux... other than the desire to do it for the sake of doing it... which, considering where we are, that's pretty much enough of a reason to do anything.
Until I can find a good way to automount the FS every boot I wil probably stay with FAT32. I played around with different methods last night quite a bit and it turned into much more of a hassle than I liked. I really regret not having it however, because of the loss of speed.

[unofficial][linux3.0][native][tarchive][experimental] ArchLinuxARM for HTC HD2

ArchLinuxARM for the leo (HTC HD2) - Native Boot
This is only tested with MAGLDR 1.13 on the T-Mobile US HD2, though there's no reason it shouldn't work on a global one, as NAND isn't touched.
Working:
Wi-Fi (with NetworkManager)
Not Working:
Bluetooth
2D & 3D Acceleration (though kgsl and freedreno drivers are in use, the userland isn't patched/installed/tested yet)
Audio
Installation (to the third partition of the SD card)
This procedure is intended only for advanced users. By providing a 6GB F2FS image, the system will boot reasonably quickly and not run out of space, however, it can't be stored as a file on the internal memory - it has to be a partition of its own because of the FAT32 filesize limit of 4GB.
You will need at least 3 MBR primary partitions on the SD card. The third one must be 6GB or larger. Since F2FS volumes can't yet be resized, any space above 6GB on that partition is useless. When this scheme is created, gunzip the provided root.img.gz and write it to the 3rd partition. Then, make the first FAT32 (if it isn't already), make a directory in root of the FAT32, and put the the linux kernel zImage.
Booting
Select the directory you created as the Android SD directory in MAGLDR and boot the system. There will be no console, and you will get a jumbled screen during boot. Eventually, lightdm will start up and you will be on your way.
Logging in
The username is "arch" and the password is "arch". Change the password ASAP.
For root, the username is "root" and the password is also "root". CHANGE THE PASSWORD ASAP!
You'll probably want to enable the On-Screen Keyboard (onboard) and set your Session to "MATE" up in the top right corner.
You can try to get reroute audio by modprobing "snd-mix-htc-leo" and setting the mixer settings. The system wasn't set to do this at each boot due to serious issues with the concept of copying a 2.6.32 alsa driver into 3.0 and just compiling - it barely works and has a huge propensity to hang during load.
Read Me
I realize this will be difficult to install for most users. I did not provide commands because I don't want anyone wiping and formatting the wrong disk. Eventually, I'll implement a way to make this installable via image. The initramfs issues with the kernel I'm using will first have to be investigated, and then the ext4 issues will. Since Arch Linux uses systemd, I can barely get it to boot with kernel = 3.0, let alone 2.6.32. All my other ports use 3.4, which already requires patches to work after the introduction of udevd version 217.
Downloads
root filesystem image compressed with gzip: https://drive.google.com/file/d/0B4WUjKii92l2ZTNraFpVb2tHbVE/view?usp=sharing
3.0.101 kernel (thank you to maniacx at github for initially sharing the source): https://drive.google.com/file/d/0B4WUjKii92l2aGdGLUYxMm9KSWM/view?usp=sharing
Kernel Source: https://github.com/willcast/kernel_leo
Also available for:
Nexus 7 2013 (flo): http://forum.xda-developers.com/nex...fficial-archlinuxarm-release-n7-2013-t2969301
HP TouchPad: http://forum.xda-developers.com/hp-touchpad/other/unofficial-archlinuxarm-release-hp-t2969310
Nexus 10: http://forum.xda-developers.com/nexus-10/general/unofficial-archlinuxarm-release-nexus-10-t2969450
Samsung Galaxy S III LTE: http://forum.xda-developers.com/gal...unofficial-port-archlinuxarm-release-t2969290
This phone just won't die.
This is what? The 20th OS to run on the HD2?
Hi There Dear friend ...
Hi there Dear @castrwilliam were looking for an OS for my HD2 to use it through Mouse and KB ( USB Host ) is there anyway I can get any os on My HD2 using them ? ( because mine's TS is broken and doesn't work ) ... Thanks in advance
With Best Wishes
Hitman1376​
OTG *should* work on this with external power. Bluetooth most likely does not. Do you have an SD card with a 6GiB third partition?
Sure ...
castrwilliam said:
OTG *should* work on this with external power. Bluetooth most likely does not. Do you have an SD card with a 6GiB third partition?
Click to expand...
Click to collapse
I have an 8 GB SDcard ... with external power ? How ? ... Thank in advance
With Best Wishes
Hitman1376​
@castrwilliam
Great job!i will download, resize mmc, install, try...
whatever issues you are facing, post them, maybe i can help after squeezing some free time
Main things are issues on the kernel.
When you try to boot with an initramfs that is compressed, you get either "garbage in compressed da" rand the kernel hangs right then - presumably before it even finishes that printk - or "unknown compression algorithm: " and then vorrupted garbage is output. This prevents me from making image boot doable.
I had this problem a long time ago with GCC 4.9 on a 3.4 flo kernel, but I've tried major versions of 4.6 through 4.9 and none get any further. Also, there's a commit upwards of mine that changed the kernel config from using ARM_UNWIND to FRAME_POINTER for debugging. I tried with each.
Also, when you boot with an ext4 rootfs on mmc, any attempt to write to root gets you an Invalid Argument, when the FS is mounted rw... very strange, but somehow I have a feeling it has to do with systemd trying to do something unsupported/untested on 3.0.x midway through boot, and f2fs lets it work either because it doesn't support it anyway, or because f2fs was backported - possibly with features that aren't in the ext4 driver already.
castrwilliam said:
Main things are issues on the kernel.
When you try to boot with an initramfs that is compressed, you get either "garbage in compressed da" rand the kernel hangs right then - presumably before it even finishes that printk - or "unknown compression algorithm: " and then vorrupted garbage is output. This prevents me from making image boot doable.
Click to expand...
Click to collapse
regarding initramfs, we have problems with magldr and 3.0.x kernels, that needs a workaround.
there's a patch for kernel (which you probably have already) for magldr boot, where you need to add 6mb of 00's to initrd.gz (not sure if for initramfs too) in order to boot on magldr
more explained: https://github.com/Gilbert32/androi...mmit/77351b60841f1b53c203b4621ea37ba521fa70a9
wondering why the 3rd partition is not itself formatted to f2fs? It can be done from an f2fs sd recovery.
I can't get this to boot from magldr, I have ~3gb fat32 p1, ~4gb ext4 p2 and 6.4gb ext4 p3
It reboots within about 6 seconds after showing white stripes on screen (just as with boot attempts using 3.0 kernels without the 6mb of zeros in initrd.gz)
I get the attached dmesg
Edit; tried making a file with 6mb of zeros called initrd.gz and putting it in the boot folder on sdcard, but the same thing happens.
feherneoh said:
For me it works with both MAGLDR and cLK
But for cLK I have to do a liveboot from PC using fastboot
EDIT:
Why are you using EXT4 on mmcblk0p3? Seems like that is the problem, as as far as I know f2fs can only be mounted with fs type defined, so probably it will only accept an f2fs partition as root
Click to expand...
Click to collapse
I just assumed it would be ext4 with an f2fs image, no wonder no replies to my first post
will try it with f2fs partition when I have time, thanks
feherneoh said:
just dd the image onto that partition, or format partition, and copy image's contents over
Click to expand...
Click to collapse
Actually I have formatted p3 to f2fs, and am adb pushing it from pc using f2fs sd recovery. It does take time though, been over an hour
Edit; oops it just reported "no space left on device", going to have to resize the partition I think. perhaps f2fs reserves more space than ext4, so needs to be bigger than the 6.4gb which worked when installing to ext4.
feherneoh said:
Don't push the whole image, just the files on it. It should be less than 6 GB, I'm using it from a 4GB card with a 3GB f2fs partition
Click to expand...
Click to collapse
Can't seem to mount the image in windows unrecognised fs
can only think to put the img onto sdcard fat32, loop mount it from f2fs recovery terminal and copy it to p3. Or get Linux on pc.
I just installed this. This is great. Thanks.
Is the display going to be always on?
Deleted... wrong thread

[Q] [Dev] What needs to be done on ROM side to support non-FAT32 microSD?

Hi folks,
I'll keep this short and sweet. New to Android dev but am a software engineer by trade.
Assuming I have a custom kernel with F2FS baked in to support AOSP/CM. I've modified my vold.fstab on my ramdisk to support F2FS on /data and /cache. Some of this was trial and error, looking at similar ramdisks on GitHub, etc.
Despite all that, it seems Android won't accept that alone for microSD. I still get "SD card is corrupt" when setting the SD card as "Portable storage".
I'm able to su mount -t f2fs /dev/block/mmcblk1p0 /mnt/randomdir no problem. However that is not "native" support and only propagates to the root user.
Any tips in the right direction? Hopefully the question is generic enough to be a general AOSP case, but if it matters I am working with Samsung Galaxy Note 3 right now (HLTE).
Thanks,
Sam

Kernel dependent file systems?

Hi there. So my problem is quite...extraordinary.
All I want is to use my 128 GB Micro SD card without errors. However, no matter what file system or configuration I used on it, it just won't work. First it won't allow me to write on it. Then it does but won't allow me to delete from it. Then I need to rescan the contents on it for apps to be able to see media. The card is in perfect condition and without flaws I assure you.
The file systems I tried so far are ext3, ext4, FAT32, NTFS, F2FS and VFAT. Tried multiple custom ROMs including Lineage, Pixel Experience and currently dotOS. It seems that file system support depends on the OS' kernel. I've given up on ext4 and F2FS thanks to the problems I mentioned before. So now I want to format my card as EXFAT. It has much better performance and compatibility than FAT32, NTFS or VFAT. Not to mention these three have significant performance change/spikes while writing and deleting. Only problem that not all kernels support EXFAT and so far neither custom ROM that I used had support built in its kernel. My latest developments is that I found a kernel out of 10 that does support EXFAT. It runs by the name Xenial. I just don't really like custom kernels so I want to avoid using them in the future if that's possible.
Any advice? Please.

Roms not recognizing SD card...

Had this problem with Pie roms as well, but settled on Bootleggers, wasn't an issue with that. Have been playing around with the Q roms now, and am seeing it again with all but Havoc so far. Device is US998, and card is formatted ext4. With most of the roms, it says "card not supported" and gives me the option to format it. In addition to not feeling like shuffling around 64 gb of data, I'm not sure what format it will format it to (this is for media storage, not internal). Definitely don't want exFat, as I've had a bunch of problems in the past with the partition table getting corrupted and needing a windows box to fix (can't be done in linux). Was hoping there was a kernel fix for this. I've tried a couple without success...
Bump... Anyone?
nola mike said:
Bump... Anyone?
Click to expand...
Click to collapse
Don't really have anything to add other than, I bother to shuffle the data if it's a rom I want to use. It seems many of the aosp based roms format it to 'fuse' of some kind. Don't think there's any other option but to use what's built into the rom.
cheers
There isn't enough info provided in the OP, so I have to ask: Is the rom designed to support ext4? Not all roms are... Android doesn't natively support it, from what I'm reading. You have to do something to add support for it (and/or you may still need to manually mount it via root). I also read that CM added this support to their releases...
Some info on how to mount manually, and other related questions: https://android.stackexchange.com/q...-system-for-microsd-cards-in-stock-or-non-lin
Either use ROMs that support Ext4 like Lineage OS and a few others or change your sd card to a different format
Also changing the kernel also affects ext4 compatibility

Categories

Resources