0

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...?

10ants
  • 255
  • 3
  • 10

2 Answers2

1

I found Solution...!

It was problem of Super SU and multi user environment of android. in case of Super SU, su --mount-master helps mount LUKS volume system widely. but unfortunately, Super SU's multi user support is still little iffy, so I replaced Super SU to Superuser. and it works perfect as I expected.

Super SU : https://play.google.com/store/apps/details?id=eu.chainfire.supersu&hl=ja

Superuser : https://play.google.com/store/apps/details?id=com.koushikdutta.superuser&hl=ja

10ants
  • 255
  • 3
  • 10
  • Are you using any additional parameters with Superuser? I tried latest version of Superuser and mounts are local just like with SuperSu. – Iwo Banas Apr 10 '14 at 08:25
  • I don't know precisely about this problem. at least in my case, solution was replace SuperSU to superuser. I recently found that you shouldn't choose mount place /sdcard/. it seems that mounting on /sdcard/ has potential error. I recommend that mounting on /mnt/foo. – 10ants Apr 11 '14 at 14:29
1

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.

Johnson Steward
  • 534
  • 3
  • 16
  • I didn't test your answer, but it would be the correct answer. When I asked the question, I couldn't find the setting application of SuperSU though. – 10ants Jan 07 '16 at 07:17
  • Explained here https://android.stackexchange.com/questions/197959/partition-gets-unmounted-automatically-in-android-oreo/200449#200449 – Irfan Latif Sep 08 '18 at 18:18