Search code examples
androidmountloopback

mounting LUKS volume on android 4.4.2, it can't be seen from another apps


I have problem with mounting LUKS volume I use Google Nexus 7 (2012) updated with Android 4.4.2 and unlocked/rooted. To mount LUKS volume, I use LUKS Manager, Busybox and Android Terminal Emulator. To see mounted file system, I use ES file explorer.

I exec the code below on Android terminal emulator

$ su
(root) dd if=/dev/urandom of=/sdcard/encvol bs=1000000 count 10
(root) mknod /dev/loop123 b 7 123
(root) losetup /dev/loop123 /sdcard/encvol
(root) lm.cryptsetup -c aes-cbc-plain -s 256 luksFormat /dev/loop123
...(enter password)
(root) lm.cryptsetup luksOpen /dev/loop123 decvol
...(enter password)
(root) mkfs.ext2 /dev/mapper/decvol
(root) mkdir /sdcard/decdir
(root) mount -t ext2 /dev/mapper/decvol /sdcard/decdir
(root) df
...
/storage/emulated/legacy/decdir  7.7M  7.7M  7.7M   1024

above operates flawlessly... so I can see lost+found directory in the /sdcard/decdir .

(root) ls /sdcard/decdir
lost+found
(root) cat > foobar
this is a test
[EOF]
(root) ls
lost+found    foobar

but when I see the directory /sdcard/decdir by ES file explorer, then I can't see any file in the /sdcard/decdir. I tried another file browser, but it was same. even in the same program, android terminal emulator, when I exit root shell, then it is no file in the decdir.

$ ls /sdcard/decdir   # not a root
...(no file)
$ df
...(not mounted)
(root) su  # be root again
(root) ls /sdcard/decdir
lost+found   foobar

is there some good ideas...?


Solution

  • My SuperSU Settings tab.

    Seems like you need to disable the "Mount namespace separation" if you want your mounts done in su visible to other apps. This may cause security flaws, but if you really need this, enable it and reboot.