[Solved] Unable to complete manual installation of Ubuntu Touch

  • Hi everyone!
    I'm very new to Android devices and I'm trying to install Ubuntu Touch on used Nexus 5 which I bought recently. I do it manually because UBports Installer did not work for me (faced this bug). I'm doing everything from Ubuntu 19.10. Everything was fine until the final step:

    adb reboot recovery

    After that installation process does not start and the phone just reboots back into UBports Recovery mode with empty /cache/recovery directory.
    Before the reboot I cat validate that in /cache/recovery directory everything is OK:

    # adb shell "ls -l /cache/recovery"
    -rw-rw-rw-    1 root     root      59501792 Oct 16  2019 device-d10a57d78402d78226606f3912cf4e26c53f297fc70fcd8a3ccf1452660f45f3.tar.xz
    -rw-rw-rw-    1 root     root           473 Oct 16  2019 device-d10a57d78402d78226606f3912cf4e26c53f297fc70fcd8a3ccf1452660f45f3.tar.xz.asc
    -rw-rw-rw-    1 root     root           864 Apr 29  2019 image-master.tar.xz
    -rw-rw-rw-    1 root     root           473 Apr 29  2019 image-master.tar.xz.asc
    -rw-rw-rw-    1 root     root           900 Apr 29  2019 image-signing.tar.xz
    -rw-rw-rw-    1 root     root           473 Apr 29  2019 image-signing.tar.xz.asc
    -rw-rw-rw-    1 root     root          1504 Apr 27  2017 keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz
    -rw-rw-rw-    1 root     root           473 Apr 30  2019 keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz.asc
    -rw-rw-rw-    1 root     root     386109304 Oct 16  2019 ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz
    -rw-rw-rw-    1 root     root           473 Oct 16  2019 ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz.asc
    -rw-rw-rw-    1 root     root           715 Dec 21  2019 ubuntu_command
    -rw-rw-rw-    1 root     root           460 Oct 23  2019 version-9.tar.xz
    -rw-rw-rw-    1 root     root           473 Oct 23  2019 version-9.tar.xz.asc

    and the command file:

    # adb shell "cat /cache/recovery/ubuntu_command"
    format system
    load_keyring image-master.tar.xz image-master.tar.xz.asc
    load_keyring image-signing.tar.xz image-signing.tar.xz.asc
    mount system
    update ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz.asc
    update device-d10a57d78402d78226606f3912cf4e26c53f297fc70fcd8a3ccf1452660f45f3.tar.xz device-d10a57d78402d78226606f3912cf4e26c53f297fc70fcd8a3ccf1452660f45f3.tar.xz.asc
    update keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz.asc
    update version-9.tar.xz version-9.tar.xz.asc
    unmount system

    Any tips whould be appreciated! Thank you!

  • @Alexey Don't think the install method will matter if there is not enough space on the device. Boot to recovery and use Android and Ubuntu actions to clear cache, wipe data etc. run the installer with wipe(snap version if you can) again. Guess if you just bought it you don't know if the partitions have been changed. There is a way to fix that but I don't have the link to hand. Ask or look through here https://t.me/WelcomePlus it's our install group. No harm in using both places. Good luck. Will check back later.

  • Thank you for reply @Lakotaubp !
    I already tried to clean up the partitions from Android actions and via CLI

    fastboot erase cache
    fastboot erase system
    fastboot erase userdata

    but it does not help. Both snap and manual installations stop at the same place.
    This Nexus 5 I bought from software developer, he used this device for testing of his apps and he used some custom Android version so the partitioning is probably the case. If I understand correctly it is impossible to find out the real partitioning from the outside of Android device. I definitely need to find the way to restore it!
    Unfortunately I don't have a Telegram account right now, because I don't use any of smart phones 🙂

  • I managed to find the real partitioning of my device. I got compiled disk utils from here and pushed them with ADB to the Nexus. Partitioning looks like this now:

    ~ # ./gdisk -l /dev/block/mmcblk0
    GPT fdisk (gdisk) version 1.0.3
    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present
    Found valid GPT with protective MBR; using GPT.
    Disk /dev/block/mmcblk0: 61071360 sectors, 29.1 GiB
    Sector size (logical/physical): 512/512 bytes
    Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
    Partition table holds up to 32 entries
    Main partition table begins at sector 2 and ends at sector 9
    First usable sector is 34, last usable sector is 61071326
    Partitions will be aligned on 1-sector boundaries
    Total free space is 990 sectors (495.0 KiB)
    Number  Start (sector)    End (sector)  Size       Code  Name
       1            1024          132095   64.0 MiB    0700  modem
       2          132096          134143   1024.0 KiB  FFFF  sbl1
       3          134144          135167   512.0 KiB   FFFF  rpm
       4          135168          136191   512.0 KiB   FFFF  tz
       5          136192          137215   512.0 KiB   FFFF  sdi
       6          137216          138239   512.0 KiB   FFFF  aboot
       7          138240          142335   2.0 MiB     0700  pad
       8          142336          144383   1024.0 KiB  FFFF  sbl1b
       9          144384          145407   512.0 KiB   FFFF  tzb
      10          145408          146431   512.0 KiB   FFFF  rpmb
      11          146432          147455   512.0 KiB   FFFF  abootb
      12          147456          153599   3.0 MiB     FFFF  modemst1
      13          153600          159743   3.0 MiB     FFFF  modemst2
      14          159744          160767   512.0 KiB   8301  metadata
      15          160768          193535   16.0 MiB    FFFF  misc
      16          193536          226303   16.0 MiB    8300  persist
      17          226304          232447   3.0 MiB     FFFF  imgdata
      18          232448          277503   22.0 MiB    FFFF  laf
      19          277504          322559   22.0 MiB    FFFF  boot
      20          322560          367615   22.0 MiB    FFFF  recovery
      21          367616          373759   3.0 MiB     FFFF  fsg
      22          373760          374783   512.0 KiB   FFFF  fsc
      23          374784          375807   512.0 KiB   FFFF  ssd
      24          375808          376831   512.0 KiB   FFFF  DDR
      25          376832         3522560   1.5 GiB     0700  system
      26         3522561         4034560   250.0 MiB   0700  vendor
      27         4034561         4096000   30.0 MiB    0700  crypto
      28         4096001         4505600   200.0 MiB   0700  cache
      29         4505601        61071315   27.0 GiB    0700  userdata
      30        61071316        61071326   5.5 KiB     0700  grow

    Could someone verify this output or share his own please? If 1.5 GiB system volume is Ok for Ubuntu Touch? Maybe something important is missing here? Also filesystem codes looks very strange to me... Sorry I'm completely noob at Android.

  • Hi,

    I had a similar trouble as yours : unable to install UT => https://github.com/ubports/ubports-installer/issues/1070
    In fact, I previously installed an unofficial rom of LineageOS => https://forum.xda-developers.com/google-nexus-5/orig-development/rom-lineageos-16-0-nexus-5-t3921162
    To do it, I needed to resize the partition => https://forum.xda-developers.com/showpost.php?p=79928889&postcount=190
    So, I have done a revert partitionning and everything went well, I was able to install UT.

  • @lool_lauris hi! Thanks for replay! I've tried this method but got an error

    ~ # hh_repart -r
    Chekcing size of partitions...
    -- Unknown partitions --

    I will try to ask previous phone owner how he did this disk layout.

  • After flashing "twrp-3.3.1-HH-hammerhead.img", through the TWRP terminal did you first resize :

    hh_repart -m

    Reboot and then, still through the TWRP terminal :

    hh_repart -r

  • @lool_lauris thank for your support! I managed to solve the problem! Previous device owner gave me this link. So I did the following:

    • installed standard twrp version to recovery partition
    • uploaded hh_clamor_repartition.zip script to the phone via adb sideload.
    • run the script in recovery mode via "stock" command in terminal

    After that I did successful Ubuntu Touch install via snap application.

    Just for the case if someone will face the same problem I put the stock Nexus 5 32GB disk layout below:

    ~ # ./parted /dev/block/mmcblk0
    GNU Parted 3.2
    Using /dev/block/mmcblk0
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) p                                                                
    Model: MMC SEM32G (sd/mmc)
    Disk /dev/block/mmcblk0: 31.3GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags: 
    Number  Start   End     Size    File system  Name      Flags
     1      524kB   67.6MB  67.1MB  fat16        modem     msftdata
     2      67.6MB  68.7MB  1049kB               sbl1
     3      68.7MB  69.2MB  524kB                rpm
     4      69.2MB  69.7MB  524kB                tz
     5      69.7MB  70.3MB  524kB                sdi
     6      70.3MB  70.8MB  524kB                aboot
     7      70.8MB  72.9MB  2097kB               pad       msftdata
     8      72.9MB  73.9MB  1049kB               sbl1b
     9      73.9MB  74.4MB  524kB                tzb
    10      74.4MB  75.0MB  524kB                rpmb
    11      75.0MB  75.5MB  524kB                abootb
    12      75.5MB  78.6MB  3146kB               modemst1
    13      78.6MB  81.8MB  3146kB               modemst2
    14      81.8MB  82.3MB  524kB                metadata
    15      82.3MB  99.1MB  16.8MB               misc
    16      99.1MB  116MB   16.8MB  ext4         persist
    17      116MB   119MB   3146kB               imgdata
    18      119MB   142MB   23.1MB               laf
    19      142MB   165MB   23.1MB               boot
    20      165MB   188MB   23.1MB               recovery
    21      188MB   191MB   3146kB               fsg
    22      191MB   192MB   524kB                fsc
    23      192MB   192MB   524kB                ssd
    24      192MB   193MB   524kB                DDR
    25      193MB   1267MB  1074MB               system    msftdata
    26      1267MB  1298MB  31.5MB               crypto    msftdata
    27      1298MB  2032MB  734MB                cache     msftdata
    28      2032MB  31.3GB  29.2GB  ext4         userdata  msftdata
    29      31.3GB  31.3GB  5632B                grow      msftdata

    Thank you all for your time guys!

  • Nice you succeed to install UT !
    It seems that you did not follow this => https://forum.xda-developers.com/google-nexus-5/orig-development/repartition-nexus-5-repartition-t3844395 ... how did you proceed ?

  • @lool_lauris I downloaded hh_clamor_repartition.zip and inspected its shell scripts. They are very simple if you are familiar with Linux system administration. Just usage of "dd", "parted" and "make_ext4fs" utils. Looking at current partitioning I figured out that my Nexus was affected by hh_repartition_32GB.sh script and to rollback the changes I just need to run the hh_stock_32GB.sh and that is it.
    Also before that for safety I did backup of crypto and grow partitions to my laptop because those scripts do that too.

Log in to reply