2

I have a bash script luks that I use in Android for mounting/umounting encrypted devices, that can be called in a terminal emulator with

 su -c "luks ..."

The script works ok for the first part, except at the mounting time, that in the script I do with:

 busybox mount /dev/mapper/${vol_arg} ${mount_path}

Despite the fact that I get exitcode 0 from this command, the device is not mounted. The command line

 su -c "mount /dev/mapper/${vol_arg} ${mount_path}"

does not work either in the terminal emulator yet it shows no error (df does not shows the device). When I try to execute it agan, I get mounting failed: device or resource busy. If I then try

 su -c "umount ${mount_path}"

I also get cant't umount...: device or resource busy. What's happening?

However, the REALLY strange point here is that, if I SSH to the tablet as root with the same terminal emulator, the command

 mount /dev/mapper/${vol_arg} ${mount_path}

mounts the device normally (??!!). In addition, if I execute the command

 'luks ...'

as SSHd root, it also works perfectly, even mounting the device.

Why does mounting is working if run as SSH root, and not through su -c?

Even more strange is the fact that the su -c thing works fine in Samsung Android 4.1.2, but not in Cyanogenmod 11 (4.4.2)...

Maybe the cyanogenmod people introduced some ugly bug?

Clues?

Thanks!!

L.

2
  • Now this is funny: after mounting through SSH, the root user sees the content of the volume in the ${mount_path}, as desired, while other users/apps see the previous content of the ${mount_path}!! It seems that Cyanogenmod mounting routines are broken. Commented Sep 8, 2014 at 0:13
  • Not a single answer...? Commented Sep 17, 2014 at 0:09

1 Answer 1

0

I upgraded to CYM 11 M10, and now su works fine. No doubt it was a bug. So now I can mount/umount encrypted stuff as I was always able to do.

It seems the problem is solved in the M10 build.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .