Sample Header Ad - 728x90

Redirect local WhatsApp directory to second partition ext4 in microSD in Android 10

1 vote
0 answers
110 views
I have googled from a month ago about on how to reach my goal, and I have found only https://android.stackexchange.com/questions/217741/how-to-bind-mount-a-folder-inside-sdcard-with-correct-permissions My goal is to link the WhatsApp directory in Samsung Galaxy S9 running Android 10 (so it is storage/emulated/0) in the second partition of my microSD card in ext4 (I have chosen that filesystem because I have got some issues when coping some data inside exFAT partition, related discussion if you are interested in [XDA Forums](https://xdaforums.com/t/copy-of-big-files-from-pc-to-microsd-return-error-trimming-file-message-error.4578733/#post-88848923)) Now, in the upper link, there are 2 modes but both doesn't satisfy me: 1. MOUNT SD CARD MANUALLY: but it's referred only to exFAT or FAT32 filesystem 2. ADOPTABLE STORAGE: it's related to the ext4 filesystem, but I'm forced to use adoptable storage that I haven't understood very well how it's different from mounting manually, and if all apps can be installed into microSD or only the apps where it's explicitly mount such this command mount -t sdcardfs -o nosuid,nodev,noexec,noatime,mask=7,gid=9997 /mnt/expand/[UUID]/media/0/WhatsApp /mnt/runtime/write/emulated/0/Whatsapp So, from what I have understood, I have executed the following commands referred to link explanation:
mkdir /data/media/0/sdext2
mount -t ext4 -o rw /dev/block/mmcblk0p2 /data/media/0/sdext2
mkdir /data/media/0/sdext2/prova
restorecon -rv /data/media/
mount -t sdcardfs -o nosuid,nodev,noexec,noatime,mask=7,gid=9997 /data/media/0/sdext2/prova /mnt/runtime/write/emulated/0/prova
And I have made a folder called "prova" to verify that from /storage/emulated/0/prova I can see the only file inside /data/media/0/sdext2/prova. But nothing is viewed while if from X-plore I navigate into mnt/runtime/write/emulated/0/prova the file is shown. Questions: 1. What are the commands to reach my goal? (I'm not an expert in Linux and Android) 2. When I use WhatsApp, the only important thing is that mnt/runtime/write/emulated/0/Whatsapp can read all files (and so no matter if from /storage/emulated/0/Whatsapp files aren't viewed?) Nothing can be made to read /storage/emulated/0/Whatsapp with files into MicroSD from X-plore as it's worked with local storage? 3. I don't remember how I created the second partition, but now the second partition is used by Link2SD and own and the group is system:system, and permission is drwxrwx--x. Is this ok? Link2SD automatically mounts partitions into /data/sdext2, but if this is a problem, I can remove the mount inside /system/bin/debuggerd script 4. Can the new commands be added to /system/bin/debuggerd script? I'm not sure, but seems that the Android 10 firmware of my Galaxy S9 doesn't support init.d.
Asked by n3o (11 rep)
Aug 25, 2024, 06:13 PM
Last activity: Aug 26, 2024, 03:05 PM