Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
0
votes
0
answers
88
views
Magisk boot mount bind script
I'm trying to mount the directory of an app to a folder in storage. I've put a script called custom.sh inside "/data/adb/service.d". The contents of the script are: ``` #!/system/bin/sh sleep 30 mount -o bind /data/data/is.xyz.mpv /storage/emulated/0/Test ``` It just doesn't work. Can anyone point m...
I'm trying to mount the directory of an app to a folder in storage. I've put a script called custom.sh inside "/data/adb/service.d".
The contents of the script are:
#!/system/bin/sh
sleep 30
mount -o bind /data/data/is.xyz.mpv /storage/emulated/0/Test
It just doesn't work. Can anyone point me in the right direction please?
JimPancakes
(1 rep)
Jan 25, 2025, 06:53 AM
1
votes
0
answers
457
views
How to get avc logging ( selinux ) in Android working?
I am on Android 10. Whether I `setenforce 0 or 1-` I cannot get `avc ( aka SeLinux )` errors logged. I checked `ramoops` files also and its ditto. root@m20lte:/ # setenforce 1 root@m20lte:/ # grep -i avc /proc/kmsg [358888.761197] [3: servicemanager: 3452] avc: received setenforce notice (enforcing=...
I am on Android 10. Whether I
setenforce 0 or 1-
I cannot get avc ( aka SeLinux )
errors logged. I checked ramoops
files also and its ditto.
root@m20lte:/ # setenforce 1
root@m20lte:/ # grep -i avc /proc/kmsg
[358888.761197] [3: servicemanager: 3452] avc: received setenforce notice (enforcing=1)
[358890.709988] [2: init: 1] avc: received setenforce notice (enforcing=1)
[358901.864803] [0:hwservicemanage: 3453] avc: received setenforce notice (enforcing=1)
^C
root@m20lte:/ # logcat -d | grep -i "avc"
07-14 08:31:21.858 3452 3452 E audit : avc: received setenforce notice (enforcing=1)
07-14 08:31:23.806 1 1 E audit : avc: received setenforce notice (enforcing=1)
07-14 08:31:34.962 3453 3453 E audit : avc: received setenforce notice (enforcing=1)
I'd like to understand avc denials
that are supposed to be logged when setenforce 0
is on so I can understand what changes to make to sePolicy
to get my exceptions incorporated . Is that going to be any easy ride or a long shot ? In the above box , besides just setenforce
notice it should have logged in a bunch of messages as I ran various apps that would trigger avc
exceptions
user1874594
(527 rep)
Jul 14, 2023, 03:15 AM
2
votes
0
answers
327
views
"Mount" a loopback device from SD card without root
I'd like to move Termux/Nix-on-droid on my SD card as I lack space on internal storage. Unfortunately, SD cards are formatted in extFat so they can't deal with stuff that are common on ext4 systems, notably symlinks. I was thinking to use for that a `.img` file formatted in ext4 using `mkfs`, and mo...
I'd like to move Termux/Nix-on-droid on my SD card as I lack space on internal storage. Unfortunately, SD cards are formatted in extFat so they can't deal with stuff that are common on ext4 systems, notably symlinks. I was thinking to use for that a
.img
file formatted in ext4 using mkfs
, and mount it somewhere. But since my device is not rooted (and I don't want to root it for various reasons) I can't mount the file, even via adb:
/sdcard $ mount DCIM/virtualfs test_mount/
mount: bad /etc/fstab: No such file or directory
Is there any trick I can do to do that? For instance using some fakechroot-like tools?
tobiasBora
(186 rep)
Oct 28, 2022, 01:31 PM
3
votes
1
answers
1819
views
Exploring options for customizing SeLinux policy ( SePolicy to enable bind-mounting ) , including kernel recompilation
As I realized `selinux for Android` is more than tad bit different creature than what I can get done on Linux . I need `SeLinux` policy to be modified so I can `bind mount` my folders. Unless that happens I dont want to root my phone. The below was when I temp `magisk rooted` my Samsing M20 in `perm...
As I realized
Here are the issues I encountered trying to achieve 👆🏻 the above.
--
--- Can I just modify the Sepolicy file at or entire
-- If changing
Here is what i did.
--- I pulled up the
selinux for Android
is more than tad bit different creature than what I can get done on Linux . I need SeLinux
policy to be modified so I can bind mount
my folders. Unless that happens I dont want to root my phone. The below was when I temp magisk rooted
my Samsing M20 in permissive
Here are the issues I encountered trying to achieve 👆🏻 the above.
--
AVC denials
aren't logged into my Logcat
. Why is that ? and should I be looking at some other file to get these. If they are disabled how can that be reversed. This is a Samsung Exynos Chipset.
root@m20lte:/ # logcat -d | grep -i AVC
06-23 03:38:03.046 4392 19898 I OMXMaster: makeComponentInstance(OMX.Exynos.AVC.Encoder) in android.hardwar process
06-23 03:38:03.112 12145 12164 I ACodec : [OMX.Exynos.AVC.Encoder] Now Loaded
06-23 03:38:03.128 12145 12164 I ACodec : setupAVCEncoderParame
--- Can I just modify the Sepolicy file at or entire
kernel
needs to be recompiled
/sys/fs/selinux/policy
. How many files need to change for a modfied custom SePolicy
to be in effect
-- If changing
Sepolicy
isn't that simple & you need to recompile
the Sepolicy
in kernel
. How do I go about doing that and before re-compile how do I test that it works for my goal
Here is what i did.
--- I pulled up the
SePolicy
which was in binary
and ran it through sepolicy command on linux . No luck.
mnt/sda2 # sepolicy -P policy
Traceback (most recent call last):
File "/usr/bin/sepolicy", line 692, in
args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
-- before that obviously I tried a low hanging fruit given by this guide where I tried using bindfs
with various userids and grouoids
including the ones exemplied in the post but I still got errors. AVC errors
not being logged I can figure our what caused these
Jason Reeves
(91 rep)
Jun 22, 2022, 11:54 PM
• Last activity: Aug 24, 2022, 09:35 AM
1
votes
1
answers
2223
views
Mounting portable SD card folder to internal folder (WhatsApp)
I am trying to mount WhatsApp media directory from portable SD to internal "SD", as the phone internal storage is very limited. My phone: Sony Xperia XZ1 Compact (32GB internal storage, 128GB external SD card), Pie 9.0, stock image, bootloader unlocked, dm-verity, and SElinux enforcing. Magisk 20.1...
I am trying to mount WhatsApp media directory from portable SD to internal "SD", as the phone internal storage is very limited.
My phone:
Sony Xperia XZ1 Compact (32GB internal storage, 128GB external SD card), Pie 9.0, stock image, bootloader unlocked, dm-verity, and SElinux enforcing. Magisk 20.1 (mount Namespace Mode= Global Namespace). bindfs v.1.14.2.
I have read and tried what is shown in these threads:
- https://android.stackexchange.com/questions/219386/how-to-bind-mount-data-and-obb-folders-from-external-sd-card-in-sdcard-and/219677#219677
- https://android.stackexchange.com/questions/203951/how-can-i-make-a-symlink-or-equivalent-inside-storage-emulated-0
- https://android.stackexchange.com/questions/217741/how-to-bind-mount-a-folder-inside-sdcard-with-correct-permissions/217936#217936
- https://android.stackexchange.com/questions/218793/why-cant-whatsapp-write-to-bind-mounts
Output of /proc/filesystems
nodev sysfs
nodev rootfs
nodev ramfs
nodev bdev
nodev proc
nodev cpuset
nodev cgroup
nodev cgroup2
nodev tmpfs
nodev configfs
nodev debugfs
nodev tracefs
nodev sockfs
nodev pipefs
nodev devpts
ext3
ext2
ext4
vfat
msdos
nodev ecryptfs
nodev sdcardfs
fuseblk
nodev fuse
nodev fusectl
f2fs
nodev pstore
nodev selinuxfs
texfat
nodev functionfs
The last relevant lines of output from mount -r
....
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,default_normal)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal)
/dev/block/sda60 on /mnt/qns type ext4 (rw,seclabel,nosuid,nodev,noexec,noatime,discard,data=ordered)
/dev/block/vold/public:179,1 on /mnt/media_rw/6534-3933 type texfat (rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,utf8,min_prealloc_size=64k,max_prealloc_size=121910k,writeback_boundary=4M,readahead=4M,fail_safe,discard,hidden=show,errors=continue)
/mnt/media_rw/6534-3933 on /mnt/runtime/default/6534-3933 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6,nocache)
/mnt/media_rw/6534-3933 on /storage/6534-3933 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6,nocache)
/mnt/media_rw/6534-3933 on /mnt/runtime/read/6534-3933 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18,nocache)
/mnt/media_rw/6534-3933 on /mnt/runtime/write/6534-3933 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18,nocache)
The output of proposed command:
bindfs -u u0_a195 -g 9997 -p a-rwx,ug+rw,ug+X /mnt/media_rw/6534-3933/WhatsApp/Media /mnt/runtime/write/emulated/0/WhatsApp/Media
Gives me the following error:
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
I then add the nonempty string to the command, and then the external SD card directory mounts as "internal".
The new lines from mount -r now reads:
/mnt/media_rw/6534-3933/WhatsApp/Media on /mnt/runtime/write/emulated/0/WhatsApp/Media type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
/mnt/media_rw/6534-3933/WhatsApp/Media on /storage/emulated/0/WhatsApp/Media type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
/mnt/media_rw/6534-3933/WhatsApp/Media on /mnt/runtime/default/emulated/0/WhatsApp/Media type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
/mnt/media_rw/6534-3933/WhatsApp/Media on /mnt/runtime/read/emulated/0/WhatsApp/Media type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
WhatsApp does READ all the files correctly, however I cannot download anything new to the drive. This is frustrating as hell, as I have come to this stage before.
I just can seem to find out how to make WhatsApp being able to WRITE to the directory.
I have used apps like apps2sd, ts-bind, fbind, mount options. Anything under the sun. I can never reach a stage longer than WhatsApp being "tricked" to read from external SD, but never being able to write to external SD.
The only working solution, is not a viable solution, is to install experimental xposed, install old module xinternalSD, and magisk module "ExSDCard Access Enabler". Then WhatsApp works perfectly, but I believe this is a very unstable for the rest of my system and my phone. And I would really like to have a more clean solution to this problem, like the one you are proposing.
Please assist in this great great headache.
Last note, also tried the command as given from your other post:
bindfs -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/6534-3933/WhatsApp/Media /mnt/runtime/write/emulated/0/WhatsApp/Media
Same result after adding nonempty option, WhatsApp can read from external SD, but cannot write to it.
Mana Goodyear
(19 rep)
Dec 24, 2019, 12:27 AM
• Last activity: Mar 6, 2022, 02:01 AM
1
votes
0
answers
455
views
Fixing bind mount on android 11 (Lineage OS)
On the lineage OS 18.1 there is my internal data somewhere but the OS has problem to mount it on `sdcard` and `emulated/0` and has no access to the files. I can see my files by `ls /data/media/0` command in `adb shell`. Is there anyway to fix it.
On the lineage OS 18.1 there is my internal data somewhere but the OS has problem to mount it on
sdcard
and emulated/0
and has no access to the files. I can see my files by ls /data/media/0
command in adb shell
.
Is there anyway to fix it.
Iman
(111 rep)
Aug 17, 2021, 07:02 PM
4
votes
1
answers
5474
views
How to mount system under super partion?
Google has recently changed the way to mount system and introduced [Dynamic Partitions][1]. Previously in a rooted adb shell, I used to run `mount -o rw,remount /system` to mount system in read-write mode. They introduced a new super.img that contains system, vendor, odm, product, etc. I have a simp...
Google has recently changed the way to mount system and introduced Dynamic Partitions . Previously in a rooted adb shell, I used to run
mount -o rw,remount /system
to mount system in read-write mode. They introduced a new super.img that contains system, vendor, odm, product, etc.
I have a simple question: How can I mount a system from a rooted adb shell in recovery?
After reading the Implementing Dynamic Partitions guide it looks like I have to
1. create system partition dynamically
2. need an entry somewhere where mount point exists
3. mount the system after the above steps.
I don't know how I can do the first step. As the information on the mounting location is inside super.img meta-data and I am unable to read it.
Anyone can put some more light here?
Vatish Sharma
(1101 rep)
Mar 11, 2020, 12:47 PM
• Last activity: Aug 6, 2021, 03:04 AM
2
votes
0
answers
415
views
How folders DCIM Download WhatsApp media redirect link binded location changed to SD card?
As in PC windows we can change default location of my documents by roaming profile or registry settings is it possible to Change default storage location (link bind redirect automove) of DCIM Download WhatsApp media Facebook or any folders to externL memory card so thT whatever saved is automaticall...
As in PC windows we can change default location of my documents by roaming profile or registry settings is it possible to
Change default storage location (link bind redirect automove) of DCIM Download WhatsApp media Facebook or any folders to externL memory card so thT whatever saved is automatically moved or downloaded or saved in external card Automatically through and shell commands without or on rooted mobile kindly share link or step by step commands ways to do the same with any folders in android
Is there any app which automove or is there any script which automoves without rooting. Eg:foldermount app (but works in rooted mobile)
Androidquery
(477 rep)
Jul 21, 2021, 07:57 PM
3
votes
2
answers
4744
views
How to fix mount errors when trying to mount the raw image that converted from android sparse image?
I have `sparse.img` image with the following properties: ``` $ file sparse.img sparse.img: Android sparse image, version: 1.0, Total of 2512896 4096-byte output blocks in 60 input chunks. ``` I want to see its contents so - I have converted it into raw image. - Created a new directory - Trying to mo...
I have
sparse.img
image with the following properties:
$ file sparse.img
sparse.img: Android sparse image, version: 1.0, Total of 2512896 4096-byte output blocks in 60 input chunks.
I want to see its contents so
- I have converted it into raw image.
- Created a new directory
- Trying to mount the raw image on to the directory
using the following commands:
$ simg2img sparse.img sparse_raw.img
$ mkdir raw
$ sudo mount -t ext4 -o loop sparse_raw.img raw
First two commands run fine and I can see sparse_raw.img
generated of size larger than sparse.img
.
Last command failed with an error:
> wrong fs type, bad option, bad superblock on /dev/loop27, missing codepage or helper program, or other error.
I think that may be the sparse_raw.img
is not an ext4
image but how can I sure about it?
I have tried to mount it as
- ext2, ext3 or without -t
- without -o loop
but nothing works.
Please suggest a way to fix it.
Vatish Sharma
(1101 rep)
Feb 27, 2020, 04:43 AM
• Last activity: Mar 22, 2021, 10:32 AM
1
votes
0
answers
435
views
Bind command on ADB to Android Emulator problem
im sorry.. im new here.. i don't know where to start. i want to run some command in emulator (android). im running certain apps, and i need it to run and not to be detectable in emulator instead as android mobile. The problem is, this command suppose to bind certain file, but its not bind.. maybe th...
im sorry.. im new here.. i don't know where to start. i want to run some command in emulator (android). im running certain apps, and i need it to run and not to be detectable in emulator instead as android mobile. The problem is, this command suppose to bind certain file, but its not bind.. maybe the bind command is wrong. see below script/command
@echo off
adb.exe kill-server
adb.exe start-server
adb.exe devices
adb root
adb remount
adb shell sleep 2
adb shell am start com.abc.im /com.abcgames.ab1.SplashActivity filter
adb shell sleep 3
adb shell pidof com.abc.im
adb shell sleep 6
adb shell for i in $(pidof com.abc.im | awk '{print $1}'); do mount --bind /proc/2/maps /proc/$i/maps; done
above if full command that i write on batch file (*.bat)
my question is in this particular command below
for i in $(pidof com.abc.im | awk '{print $1}'); do mount --bind /proc/2/maps /proc/$i/maps; done
its not working. can anybody help me correct it?
p.s - sory for my poor english... TQ
HazeRiff Technician
(11 rep)
Sep 6, 2020, 10:43 AM
2
votes
0
answers
92
views
mounting an app folder to external storage fails for Write access on Android Q but will work in Android Pie
I could mount my partitions holding whatsapp (exFat) and titanium ( ext4 ) backup data on `android Pie` but right now on `Q` it will not let a RW operation be performed after mounting I understand /sdcard is a virtual emulated FS and the fact that there are app specific views etc. But after going th...
I could mount my partitions holding whatsapp (exFat) and titanium ( ext4 ) backup data on
So lemme explain a bit where I come from
: {} I can successfully
{} I need to similarly mount an
{} I found somewhere a
{} Now with everything the same I Could
android Pie
but right now on Q
it will not let a RW operation be performed after mounting
I understand /sdcard is a virtual emulated FS and the fact that there are app specific views etc. But after going through all that perplexing stuff, I couldn't crystallize on a working solution.
I've gone through a related Q on stack but none of these approaches work for me.So lemme explain a bit where I come from
: {} I can successfully
bind mount /storage/emulated/0/WhatsApp
to exFat /storage/[UUID]/WhatsApp
for RW
. Obviously because exFat
is Permission
unaware file system. Did a regular mount and it will mount to /mnt/media/runtime/[Read & Write & Full & Default]
with 3 separate 'mask'
options mask==6 , 7 and 23
( BTW that mask option isn't quite your umask
. Its '*decimalized*' umask
-convert that 7 to binary to get real umask
). So in fact it invokes the same path as mentioned in the article behind the covers viz /mnt/media/runtime/[Read & Write & Full & Default]
{} I need to similarly mount an
ext4
partition
with Titanium backup
. Here are the issues.
If I mount /storage/emulated/0/Titanium to ext4 /storage/[UUID]/Titanium
( like I mentioned in fact it mounts to /mnt/media/runtime/[Read & Write & Full & Default]
with 3 separate 'mask'
options underneath. With this mount. I can Restore Apps but cant backup Apps. So R is allowed RW
is not and I granted Titanium Root access. Maybe the explorer components of that apps are not using Root level access.
Somewhere i read - mount using correct options of sdcardfs
and 'fuse`. My question is *precisely How* ?
{} I found somewhere a
bindfs binary
but it does not work with my CPU Architecture
{} Now with everything the same I Could
RW
using above approach in Android Pie
. This is an issue with Android Q
...what changed ? how do I work around ?
Jason Reeves
(91 rep)
Apr 5, 2020, 02:59 AM
0
votes
0
answers
703
views
Mount USB OTG to specific destination folder on Nexus 6
I have an app that looks for videos in a specific folder: “videos”. I'm trying to get my FAT flash drive to mount on the folder videos under `/sdcard` internal storage. Nexus 6 (no SD card slot) LineageOS 16 (Android 9) Tried: ``` ~$ su -mm ~# mount -o bind /mnt/sdcard/videos /mnt/media_rw/A064A9EB6...
I have an app that looks for videos in a specific folder: “videos”. I'm trying to get my FAT flash drive to mount on the folder videos under
/sdcard
internal storage.
Nexus 6 (no SD card slot)
LineageOS 16
(Android 9)
Tried:
~$ su -mm
~# mount -o bind /mnt/sdcard/videos /mnt/media_rw/A064A9EB64A9C3FE
Did not work and editing the fstab
file does not save after reboot.
Android fstab
file:
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#
# NOTE: /system partition is now early-mounted and the fstab entry is specified in device tree (duplicated below for recovery image purposes only):
#
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait,recoveryonly
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,noauto_da_alloc,nobarrier wait,check,formattable,latemount,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata,reservedsize=128M
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs rw,nosuid,nodev,noatime,inline_xattr wait,formattable,latemount,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata,reservedsize=128M
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,noatime,nosuid,nodev,barrier=1,data=ordered wait,check,formattable
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,nosuid,nodev,noatime,inline_xattr wait,check,formattable
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware ext4 ro,barrier=1,context=u:object_r:firmware_file:s0 wait
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,nosuid,nodev,noatime,barrier=1 wait,check,notrim
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/modem /modem emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs1 /mdm1m9kefs1 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs2 /mdm1m9kefs2 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs3 /mdm1m9kefs3 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sbl1 /sbl1 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/tz /tz emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/rpm /rpm emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sdi /sdi emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/aboot /aboot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/versions /versions emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/logo /logo emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/frp /persistent emmc defaults defaults
/devices/*/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto
/dev/block/zram0 none swap defaults zramsize=536870912,notrim,max_comp_streams=4
Hard to find info on Android mounting system. These are what I have found:
- https://android.stackexchange.com/questions/219386
- https://android.stackexchange.com/questions/203951
- https://android.stackexchange.com/questions/62680
- Let's clear up the confusion regarding storage in Android once and for all, including adoptable storage in Marshmallow.
- How the Mount SD Card Android Process works
Corey Easley
(1 rep)
Mar 31, 2020, 05:11 AM
• Last activity: Mar 31, 2020, 05:36 AM
3
votes
1
answers
3270
views
How to bind-mount "data" and "obb" folders from external SD card in "/sdcard/Android"?
Can someone help me mount my `Android/data` and `Android/obb` in my internal storage from my portable storage? I'm on a Pie ROM. I found this: https://android.stackexchange.com/questions/217741/how-to-bind-mount-a-folder-inside-sdcard-with-correct-permissions but I don't know what should I do. When...
Can someone help me mount my
Android/data
and Android/obb
in my internal storage from my portable storage? I'm on a Pie ROM.
I found this: https://android.stackexchange.com/questions/217741/how-to-bind-mount-a-folder-inside-sdcard-with-correct-permissions but I don't know what should I do.
When I type:
ls -dZ /sdcard
I get
u:object_r:rootfs:s0 /sdcard
mahanr
(33 rep)
Dec 13, 2019, 04:43 PM
• Last activity: Dec 24, 2019, 12:03 AM
1
votes
1
answers
240
views
How to bind mount libunionfs?
Samsung has introduced a feature in its stock ROM that moves content of social media aps (like WhatsApp) to SD card, and then links the two folders. I ran the following command in Termux: ```` $su #mount | grep -i "whatsapp" ```` The following output was returned: ```` libunionfs /mnt/runtime/defaul...
Samsung has introduced a feature in its stock ROM that moves content of social media aps (like WhatsApp) to SD card, and then links the two folders.
I ran the following command in Termux:
`
$su
#mount | grep -i "whatsapp"
`
The following output was returned:
`
libunionfs /mnt/runtime/default/emulated/0/WhatsApp fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
libunionfs /storage/emulated/0/WhatsApp fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
libunionfs /mnt/runtime/read/emulated/0/WhatsApp fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
libunionfs /mnt/runtime/write/emulated/0/WhatsApp fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
`
I learnt from the net that libunionfs
is a virtual file system. How did Samsung create bind mounts to this system? Normal #mount -o bind
didn't work.
Wrichik Basu
(957 rep)
Nov 19, 2019, 06:51 AM
• Last activity: Nov 23, 2019, 01:06 AM
2
votes
1
answers
532
views
Why can't WhatsApp write to bind mounts?
I moved all the data of WhatsApp to ````/mnt/media_rw/6333-6461/WhatsApp````, where 6333-6461 is my external SD card. I opened WhatsApp to find that I could not open any previously downloaded data. This is expected. Now, I executed the following commands in Termux: ```` $ su # mount -o bind /mnt/run...
I moved all the data of WhatsApp to
/mnt/media_rw/6333-6461/WhatsApp
, where 6333-6461 is my external SD card. I opened WhatsApp to find that I could not open any previously downloaded data. This is expected.
Now, I executed the following commands in Termux:
`
$ su
# mount -o bind /mnt/runtime/write/6333-6461/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp
`
When I opened WhatsApp, I could see all the data that I had previously downloaded. But now I cannot send or receive anything - all sending fails, camera access from WhatsApp fails, and downloading fails.
Evidently WhatsApp is not being able to write onto the bind mount. Any solution to the problem?
My phone, a Samsung Galaxy On7, Android 6.0.1, is rooted with Magisk 20.1 and running stock ROM.
Wrichik Basu
(957 rep)
Nov 22, 2019, 09:09 AM
• Last activity: Nov 22, 2019, 10:48 AM
0
votes
0
answers
190
views
Where is a file actually located in case of bind mounts
I have a rooted phone with Magisk 20.1 running on it. Inspired by [this answer on Unix SE][1], I successfully created a bind mount using Termux. It was between a folder on external SD card and one in the internal storage. The commands executed are as below: >su >mount -o bind /storage/6333-6461/Book...
I have a rooted phone with Magisk 20.1 running on it. Inspired by this answer on Unix SE , I successfully created a bind mount using Termux. It was between a folder on external SD card and one in the internal storage. The commands executed are as below:
>su
>mount -o bind /storage/6333-6461/Books /storage/emulated/0/Books
The original folder in SD card is about 9GB, and my phone memory had only 1.2GB free. Needless to say, thanks to the Linux architecture, there was no problem because the folder in internal storage was just pointing to the one in SD card.
Now, I placed a test file in
/storage/emulated/0/Books
, and it was instantly visible in the original folder in SD card.
Then I removed the bind mount using the command >umount /storage/emulated/0/Books
. I found that the test file was still there in the original folder in SD card.
My question is: When I placed the test file in the bind mount before unmounting, where was it _actually_ located: in internal storage or external SD card? If I place a large file in the bind mount (i.e. in /storage/emulated/0/Books
), where will the file take up space: in the internal storage or the SD card?
Wrichik Basu
(957 rep)
Nov 17, 2019, 02:23 PM
Showing page 1 of 16 total questions