As I am aware after Android
4.4 or some sort your storage card is no longer eXposed directly and needs to be carefully interfaced through specific Mount
points that need to be aware through vold
system
My question is given this situation and the fact that ext4
is very complicated in terms of of access and especially with now SeLinux
sitting on top of it
it is somehow still possible to render ext4
support when it did not exist initialy as has been the case for lineage
and previous similar OS's
that would be the case if the mount points are created at boot time and then vold
is made aware of them
what I did
since I am rooted
( magisk
) I use su mount master
and mounted these manually but trying to then use vold
failed because it was too late
I found some articles about how how this was achieved in earlier Android versions upto 5.
after 7.6 Android world has become even more paranoid on security and seLINUX
couldn't have been more fussier
from 7.x onwards Android versions I would like to know if there is a definitive guide about how this can be done .I do not mind recompiling this feature in the kernel. this is a far more rewarding investment then trying to look for custom ROMs and moving away from stock just because you want EXT4
support
so how do I I add
EXT4
support on stock and similar ROMs
for Android versions > 7.x and do this the right way where all apps can access my partitions. all my partitions are
EXT4
this is quite in contrast to the the second partition
app2sd
approach that is used to save space. of course I have that as well but I have two more partitions used for extSD
( main external data storage partition ) and one devoted to to another app. totally 3
EXT4
partitions . first one is the main data partition ,2nd is app2sd
and third is a special partition devoted to one app.
if it matters I am rooted on a Samsung device running stock nougat 7.x.
another thing that I observed and I will update the question accordingly is all of a sudden out of nowhere partitions mounted under /storage are now read only earlier they were not so. I can still read write to them through /mnt/media_rw I wonder what went wrong because lot of apps depend on accessing my partitions through /storage Mount point.
So just to summarise here are the questions:
- Mount multi
ext4
partitioned external card at boot time, as against manual mounting which I can do. - Mount it the correct way with the right group ID, so that
vold
gets to know it has been mounted and all apps and process can freely access the partition. - All external partitions under
/storage
suddenly became read only (internal memory partition is of course read write always).tune2fs
confirmed that all partitions are clean. Why does this happen and how can it be fixed?
thanks for response. I put this question that sounded like a narrative since I did not have screenshots or logs at hand if that is what you meant in your opening comment in answer. So here's what I am trying to achieve but run into all kinds of errors.
1) Mount mmck1p2
to /data/sdext2
and I keep getting error failed to mount ...mmcblk1p2
on .....invalid argument
& another similar line
failed..... /dev/block/vold/public
on .... invalid args. that is via app2sd
and my magisk
has global option turned on
the same partition is already mounted at boot under media_rw and storage
Bind mounting
camera DCIM
and many other folders in internal storage fails when target is /storage/part#
& it earlier worked well. My partitions are clean as per tune2fs
report . What happened ?
Thanks again. Answering your Q's here :
1) What are currently mounted filesystems (output of mount)?
o/p is too big to fit in here. PFA
2) Output of /system/bin/id?
for normal user
uid=10112(u0_a112) gid=10112(u0_a112) groups=10112(u0_a112),1015(sdcard_rw),1023(media_rw),1028(sdcard_r),3003(inet),9997(everybody),50112(all_a112) context=u:r:untrusted_app:s0:c512,c768
3) What command exactly did you use to mount mmck1p2 to /data/sdext2? 4) What command exactly did you use to bind mount DCIM folder?
1 mount -o,rw /dev/block/mmcblk1p1 /storage/extsd
2 lp=/sdcard/logger.txt
4 ls./mnt/media_rw
5 ls /mnt/media_rw
6 mkdir -p $_/extsd
7 mount --bind /storage/extsd $_
8 ls $_
with above run from terminal I am able to see files from terminal only. if run from adb
I get the same situation
. Thought adb
would be persistent but ain't the case.
after that I tried to invoke vold with the hope it would make my mount persistent and visible but no luck there either
dreameltemtr:/ # /system/bin/vold
/system/bin/vold
Aborted
134|dreameltemtr:/ # /system/bin/vold --blkid_context=u:r:blkid:s0 --blkid_untrusted_context=u:r:blkid_untrusted:s0 --fsck_context=u:r:fsck:s0 --fsck_untrusted_context=u:
r:fsck_untrusted:s0
ntext=u:r:fsck:s0 --fsck_untrusted_context=u:r:fsck_untrusted:s0 <
SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:magisk:s0 RAM:SEPF_SECMOBILE_7.1.1_0003, [-1 -1 -1 -1 0 1]
also to mount partition
# 2 via app2sd
there is a mount
script that the app writes to /system/bin/etc or /data/app2sd
dir's depending on the opts you choose. It uses the similar approach except that
-- I used its own binary for the bind mount functionality
-- I will do periodic tests to see if certain partitions get mounted
-- It will run these periodically ( kind of patched many scripts together ) hoping that one will work
-- I attempts to mount via block device ( /dev/block/mmcxxx
) as well as vold
( /dev/block/vold/nnn
)
Here is that script & you will see what I just said . Again PFA since there is a ceiling to max chars on a post.
4) What are exact error messages? –
exact messsages are 2 lines from app2sd
gui
attention box
- Failed to mount /dev/block/ mmcblk1p2 to /data/sdext2 invalid argument <br>
- Failed to mount /dev/block/vold/public/179:34 to /data/sdext2 invalid argument<br>
On the last part where I cant write to external partitions
mounted under /storage
That instance of ROM install was abortive . It caused repeated boot-loops
after 10 mins so I just restored my Nandroid
backup. So I cant dig out more details .
ext4
and mount it manually wherever you want.ext4
support is present on every ROM - stock or custom - since the first release of Android. What exactly your question is?