[HowTo] [OPO] Fix MTP driver permissions

  • Infrastructure

    Currently MTP access is broken on the OPO and users cannot access their files easily. While a fix has been pushed for 16.04 (OTA-4) already, current vivid needs to be fixed manually.

    Warning: This fix needs to be applied carefully, it can damage your system files! You need to type those commands on your PC in a shell window, not on the phone itself:

    1. Reboot your phone into recovery: adb reboot recovery
    2. Open an adb shell into your phone: adb shell
    3. Create a temporary directory /a, and loop-mount the system image into it: mkdir /a && mount /data/system.img /a
    4. Create a temporary directory /b, and loop-mount the android image into it: mkdir /b && mount /a/var/lib/lxc/android/system.img /b
    5. exit adb shell by pressing CTRL-D
    6. Transfer the rules file to your PC: adb pull /b/ubuntu/usr/lib/lxc-android-config/70-bacon.rules
    7. edit the file with your favourite text editor and change the following: from ACTION=="add", KERNEL=="mtp_usb", OWNER="root", GROUP="mtp", MODE="0660" to ACTION=="add", KERNEL=="mtp_usb", OWNER="root", GROUP="plugdev", MODE="0660" (Note the changed group)
    8. Push back the changed file: adb push 70-bacon.rules /b/ubuntu/usr/lib/lxc-android-config
    9. To be safe, re-enter the adb shell: adb shell
    10. Force changes to disk: sync && umount /b && umount -l /a && sync
    11. exit adb shell by pressing CTRL-D
    12. reboot device and hope its working: adb reboot

    Hope that works for you!

    BR Florian

  • Florian, this works well. Thank you for the fix.

    /a would not umount, giving me the error umount: can't umount /a: Device or resource busy I couldn't see easily what was keeping it busy, so I just tossed umount the -l (lazy) flag, and it worked fine.

    I also had to issue a CTRL-D between steps 10 and 11.

    After reboot, MTP worked fine.

    Thanks again!


  • Infrastructure

    @trainailleur Good I updated my guide!

  • Community

    Well this was really really easy to do.

    I take my hat off to you Florian for taking the time to sort this guide out and write it up.

    I followed it and ...yes it is idiot proof!

    It worked.

    The only change I would make is to insert the word "text" in 7 between favourite and editor

    Now my OPO rebooted and mounted automatically


  • After typed adb reboot recovery, I obtain this message:

    error: device offline

    Known OPO error never resolved

  • Thanks @Flohack, your HowTo worked perfectly.

    Step 1 did not work on my OPO, so I had to put it manually into recovery mode (Powerbutton + volume down for a few seconds (while it is switched of)). Then steps 2 - 12 went smoothly. Thanks for the HowTo!!!

    @rocky58: If adb reports "device offline", then it sometimes helps to simply wait for a few seconds or to unplug and plug in again the USB cable. This worked for me.

  • Okkkkkkkkey... all worked fine. At last I can mount my OPO using my Ubuntu PC.
    Thanks @Flohack for the job and also @GT for the suggest.

  • @flohack helping a user in the UB Welcome & Install Group he thought he have to type all the commands on the phone screen. So maybe is a good idea to add the step Connect the PC or laptop to the phone using a USB cable or something like that.

    Thank you for your guide!

  • Infrastructure

    @advocatux OK thanks added a hint :)

Log in to reply

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.