How to connect an ext4 external drive on Android and make it accessible to all applications

I wrote the following shell script:

alias mount='/system/xbin/busybox mount' set -e set -x MNT=sda1 function mkdir_ext() { if [ ! -d $1 ]; then mkdir -p $1 fi chown $2 $1 chmod $3 $1 } mkdir_ext /storage/emulated/$MNT root:media_rw 777 mount -t ext4 /dev/block/$MNT /storage/emulated/$MNT mkdir_ext /data/media/$MNT root:media_rw 777 sdcard -u 1023 -g 1023 /storage/emulated/$MNT /data/media/$MNT 

After executing the above commands, mount the reports:

 root@NEO-X8 :/sdcard # mount|grep sda /dev/block/sda1 /storage/emulated/sda1 ext4 rw,seclabel,relatime,data=ordered 0 0 /dev/fuse /data/media/sda1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0 

I work through ssh remotely using the ssh / sftp root daemon , and during login as root I can list the files in /storage/emulated/sda1 .

From what I understand, android is not case sensitive with respect to file systems by design, so the file system should be fused.

The problem is that I see an empty directory in /data/media/sda1 . Even stranger is that if I go to /storage/emulated/sda1 from a root device using the bash shell of X , I also see an empty directory.

I tried other other applications and I tried using sdcard_rw instead of media_rw (with uid / gid 1015 instead of 1023), nothing works.

How to make ext4 work for all Minix NEO X8-H based applications? Using anything other than ext4 is not an option; a 4TB drive already contains important data. As a note, sda1 is just a small 1 GB partition.

+5
source share
2 answers

I assume that your device is rooted in what you have done so far, so it won’t do it. Although I cannot be sure that this is your problem, I will explain how I solved this problem.

Modern versions of android in order to improve the security of devices now use the (somewhat half-reasoned) function of creating mounts performed by most processes that are not visible to other processes. The work around this disappoints the device's specifics, however, it seems that Minix NEO X8-H uses the original “vanilla” style build for android. Therefore, you have a good chance to use StickMount to install a USB drive, it should enable the global installation of USB devices with any file system supported by your ROM (which should include ext4 if you already installed it before).

I have not personally tested this on my device, so I can’t guarantee that it will work, but it has been successful with a number of other Android devices, so it’s definitely worth taking a picture.

+2
source

I use the mkfs -t ext4 /dev/sdf2 format SD card and insert the samsung s4 anrdoid into the phone.

 adb shell su mount /dev/block/mmcblk1p2 /root 

I can not install this SD card, I have googled, but no solution.

Last, I found that this could succeed :)))

 mk2fs -t ext4 /dev/sdf2 and ... 
0
source

All Articles