UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    problems flashing UBports on Meizu PRO 5 (Android international edition)

    Scheduled Pinned Locked Moved Support
    39 Posts 9 Posters 13.3k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • S Offline
        Stefano
        last edited by Stefano

        yeah, that's an advanced procedure, don't know if you're familiar with fdisk and gparted , but if you read that post carefully first, it will shed some light on you.
        You need to reboot to TWRP recovery and adb shell from your PC.
        You need to decrease the size of partition 42 ( sda 42 )(custom)

        /dev/block/sda42 720896 797700 76805 300M Linux filesystem
        /dev/block/sda43 851968 983039 131072 512M Microsoft basic data
        /dev/block/sda44 983040 7633914 6650875 25.4G Microsoft basic data

        and increase the size of partition 43(sda43) (cache)

        I decreased the 42 to 300M and increased 43 to 700 (-ish) and 16.04 installed without any issue then

        In your case the partitions start and end block will be different as you have 64Gb version of PRO5, but that's not an issue.

        Just follow the instrucions ;

        reboot to TWRP,
        In terminal on your PC write;

        mount /dev/block/sda41 /system
        mount -t proc proc /system/proc
        mount -t sysfs sys /system/sys
        mount -o bind /dev /system/dev
        chroot /system /bin/bash

        type: fdisk
        type: fdisk /dev/block/sda

        type: m
        Now you should be in the menu of FDISK utility,

        have a look at the commands.

        type: p

        the output should be your phone partition table, copy it and save it to Libre Office writer or whatever you want( gedit...etc)

        Now you can see your partitions 42 and 43 which are of your interest.
        You need to decrease the size of 42 and increase 43.
        About 725M for partition of 43 would suffice, but you can give it more if you'd like.
        Remember what you add to 43 you need to take from 42.

        Here is my table for comparison only:

        Device Start End Sectors Size Type
        /dev/block/sda1 1024 1279 256 1M Microsoft basic data
        /dev/block/sda2 1280 1343 64 256K Microsoft basic data
        /dev/block/sda3 1344 1407 64 256K Microsoft basic data
        /dev/block/sda21 2048 3071 1024 4M Microsoft basic data
        /dev/block/sda22 3072 5119 2048 8M Microsoft basic data
        /dev/block/sda23 5120 5631 512 2M Microsoft basic data
        /dev/block/sda24 5632 6655 1024 4M Microsoft basic data
        /dev/block/sda25 6656 7679 1024 4M Microsoft basic data
        /dev/block/sda26 7680 13823 6144 24M Microsoft basic data
        /dev/block/sda27 13824 22015 8192 32M Microsoft basic data
        /dev/block/sda28 22016 30207 8192 32M Microsoft basic data
        /dev/block/sda29 30208 35327 5120 20M Microsoft basic data
        /dev/block/sda30 35328 40447 5120 20M Microsoft basic data
        /dev/block/sda31 40448 45567 5120 20M Microsoft basic data
        /dev/block/sda32 45568 50687 5120 20M Microsoft basic data
        /dev/block/sda33 50688 55807 5120 20M Microsoft basic data
        /dev/block/sda41 65536 720895 655360 2.5G Microsoft basic data
        /dev/block/sda42 720896 797700 76805 300M Microsoft basic data
        /dev/block/sda43 797952 983039 185088 723M Microsoft basic data
        /dev/block/sda44 983040 7633914 6650875 25.4G Microsoft basic data

        NOW, delete the 42 partition by typing: d
        it should ask you the number of partition
        Command (m for help): d
        Partition number (1-3,21-33,41-44, default 44): 42

        Partition 42 has been deleted.

        Now you need to create a new 42 partition with smaller size
        type: n
        it will ask you for a partition number and you'll type 42
        now it's asking for a first sector and you'll need to calculate the size as your 64Gb phone has a different partition table as mine 32Gb.

        the first sector should stay the same, just press enter on keyboard,
        the end sector you'll need to try to guess it. I've used end sector of 790000 instead of 810000, thus gaining some space for partition 43, but you'll need to try it on you own.
        NO WORRIES, unless you save it, it won't be set, you can try it again and again, just by pressing q and enter
        Then again typing: fdisk /dev/block/sda
        and you'll be in the fdisk menu again, without any changes to the partition table, you can verify this by typing: p
        I know it's a good game to try to guess the partition size, I've gone through that as well.

        Anyway, when you finally manage to set the right end sector of partition 42, you'll need to change the partition type as at the moment is LINUX FILE SYSTEM and we nee a MICROSOFT BASIC DATA ( or type 6 )
        In order to do that, type command : t
        It will ask you for a partition No, you type: 42
        Now it will ask for a type of the partition 42
        type in: l
        It will list all known file types, as you can see we need the No. 6 or MICROSOFT basic data
        type: 6
        Changed type of partition 'Linux filesystem' to 'Microsoft basic data'.

        Now go back and verify that by typing: p

        it should list again the partition table with changed 42 partition size and file type.

        You'll need to verify this by typing: v

        See something like this?
        Command (m for help): v
        No errors detected.
        Header version: 1.0
        Using 20 out of 128 partitions.
        A total of 11386 free sectors is available in 3 segments (the largest is 38 MiB).
        So it's verified.

        Now type: x
        It will take you to expert menu/mode.
        You'll need to change the name of the partition 42 to ''custom''
        To do that, type: m

        This should appear on you Terminal:

        Expert command (m for help): m

        Help (expert commands):

        GPT
        i change disk GUID
        n change partition name
        u change partition UUID
        M enter protective/hybrid MBR

        A toggle the legacy BIOS bootable flag
        B toggle the no block IO protocol flag
        R toggle the required partition flag
        S toggle the GUID specific bits

        Generic
        p print the partition table
        v verify the partition table
        d print the raw data of the first sector from the device
        D print the raw data of the disklabel from the device
        f fix partitions order
        m print this menu

        Save & Exit
        q quit without saving changes
        r return to main menu

        O.K ,type: n
        type:42

        Give it a new name as prompted.
        Type: custom

        Now type: r
        it takes you back to main menu of FDISK utility.

        Type: w
        it writes the changes and saves them.
        Now you should be back in adb shell as root@localhost #
        Good,
        you'll need to format the newly created partition of 42, by typing:
        mke2fs -t ext4 -m 0 /dev/block/sda42

        This should look the output like:

        root@localhost:/# mke2fs -t ext4 -m 0 /dev/block/sda42
        mke2fs 1.42.12 (29-Aug-2014)
        /dev/block/sda42 contains a ext4 file system
        created on Fri Jan 26 19:09:44 2018
        Proceed anyway? (y,n) y
        Discarding device blocks: done
        Creating filesystem with 76805 4k blocks and 76896 inodes
        Filesystem UUID: f7f0db2f-b0e9-4bf7-bf94-ae843a409094
        Superblock backups stored on blocks:
        32768

        Allocating group tables: done
        Writing inode tables: done
        Creating journal (4096 blocks): done
        Writing superblocks and filesystem accounting information: done

        Now to verify if the partition 42 has been decreased in size, reboot the phone to TWRP recovery and again do this steps:

        adb shell

        mount /dev/block/sda41 /system
        mount -t proc proc /system/proc
        mount -t sysfs sys /system/sys
        mount -o bind /dev /system/dev
        chroot /system /bin/bash

        Now go back to fdisk utility by typing: fdisk /dev/block/sda

        and verify the changes in partition 42 by typing: p

        You should see the partition 42( sda42) decreased in size
        If true, congratulation, now to increase the partition 43 (sda43) which is our main interest off course.

        Go back and do the same steps for partition 43 ,delete it, create it, increase the size, change the name to ''cache'', save it, then format it, verify , just like with the partition 42.

        I guess you'll be busy today 🙂 Have fun.

        T 1 Reply Last reply Reply Quote 1
        • B Offline
          BlandCorporation
          last edited by

          Dude thank you so much for your guidance! Your instructions worked perfectly (a minor note for others reading is that the sda43 partition should be named "cache"). I've now got a nifty partition table all set up for 16.04. 😄

          I'm currently fighting with the UBports Installer and ubuntu-device-flash to try to get actual flashing of UBports system images to the device working (still the only working system has arisen from your TWRP backup). I've no idea what's wrong, but am wondering if there's an ADB authorization problem preventing the installers/flashers from working. I may try getting a UBports 16.04 image and manually transferring files from it to partitions on the device using the TWRP terminal...

          S 2 Replies Last reply Reply Quote 0
          • S Offline
            Stefano @BlandCorporation
            last edited by

            @blandcorporation I might do a new16.04 backup of fresh install and upload it, then you can try to restore it and later update it.

            1 Reply Last reply Reply Quote 0
            • S Offline
              Stefano @BlandCorporation
              last edited by Stefano

              @blandcorporation Here is the 16.04 PRO 5 latest backup zip file, unpack it, put it to your TWRP backup folder and restore.
              https://drive.google.com/file/d/1e91EPP0RfP3T8xFsNH26f4ORNeJbz__A/view?usp=sharing

              M 1 Reply Last reply Reply Quote 0
              • B Offline
                BlandCorporation
                last edited by

                My goodness, thanks again! Genuinely thanks for your guidance on this. It is hugely appreciated. 😄

                I actually went and manually downloaded the partition images for 16.04 and (carefully) extracted them on the phone and that worked also. I'm now happily running UBports 16.04 development with Anbox. I can't believe what I'm seeing. What the UBports team has achieved is amazing!

                1 Reply Last reply Reply Quote 2
                • M Offline
                  Marathon2422 @Stefano
                  last edited by

                  @stefano oow thats tempting

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TartanSpartan @Stefano
                    last edited by TartanSpartan

                    @stefano Hi there. I am trying to resize my 64GB Pro 5's partition table to enable me to install Xenial. I installed TWRP again and did an adb shell on my desktop. Following your guide, I get to chroot /system /bin/bash and then the prompt says "bash: groups: command not found". Then the user in the prompt changes to "root@localhost:/#". I then tried the command again and now it says "bash: chroot: command not found". Puzzled, I tried to do it from TWRP's integrated terminal, straight on the phone. Is there a reason a host PC has to do it via ADB, though? Then on TWRP the command returned "bash: groups: command not found", "bash: lesspipe: command not found" and "bash: dircolors: command not found". Are any of these warnings problematic enough for me to not be able to resize the partitions without correcting for them?

                    Furthermore, can anyone list the exact metrics of their sda41 through sda44 partitions after a succesful resize on a 64GB model? The start and end points, the size, etc?

                    Note: I came back to edit this message because the browser on my M10 often cuts out because of too many tabs, so I didn't want to lose it and made it a work in progress.

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      Stefano @TartanSpartan
                      last edited by

                      @tartanspartan just read the post about, you'll understand it.

                      T 1 Reply Last reply Reply Quote 0
                      • T Offline
                        TartanSpartan @Stefano
                        last edited by

                        @stefano As is now clear I elaborated on my problem. The guide does not cater for these issues. Can you please read what I said and see if you can help me?

                        S 1 Reply Last reply Reply Quote 0
                        • S Offline
                          Stefano @TartanSpartan
                          last edited by

                          @tartanspartan yeah, it might trow out some errors, but should be ok to continue with resizing. It thrown errors for me too.
                          With exact sda41 up to sda44 I can't help as I only have 32Gb version of Pro 5. Maybe some else could help?

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            Math
                            last edited by

                            @Stefano : Hello. I try to put my Pro 5 15.04 in 16.04 (formerly Android) but I can't.
                            I tried with your method to increase the cache but I have too much error message.
                            I wonder if you received an echo with the use of gparted. if it works or not.

                            And second query, if I turn everything except TWRP, will it work with "ubports-installer" or I would still have to increase the cache?

                            thank you in advance

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              Stefano @Math
                              last edited by

                              @math if you follow the guide carefully, you should be able to resize the .cache partition. Ignore the error messages and just continue.

                              By restoring the Backup 16.04 stable with TWRP, just download it, unpack it and then restore it. Afterwards, you'll only need to flash Ubuntu Recovery with fastboot.
                              But, the future updates (OTA-stable, rc, devel ) might fail due the size of the .cache (if you don't resize it before) , otherwise you should be able to use Ubports installer.

                              M 1 Reply Last reply Reply Quote 0
                              • M Offline
                                Math @Stefano
                                last edited by

                                @stefano Thank you very much. I will try again. But you think OTAs in the future will be bigger and bigger. Or it's only for the passage in 16.04

                                S 1 Reply Last reply Reply Quote 0
                                • S Offline
                                  Stefano @Math
                                  last edited by

                                  @math Difficult to say, but I've seen a discussion of Ubports devs about shrinking the image size of futures OTA's .

                                  M 1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    Math @Stefano
                                    last edited by

                                    @stefano I made the change sda42-43.
                                    But when I wanted to install the 16.04 with ubsports-installer 0.1.20, it still put me the error "boot.img".
                                    Whereas with the version 0.1.12, the installation 16.04 did well.
                                    Hoping that the OTA 5 will be fine.

                                    thank you for your explanations

                                    S ? 2 Replies Last reply Reply Quote 0
                                    • S Offline
                                      Stefano @Math
                                      last edited by

                                      @math Make sure you have installed latest fastboot and adb on your PC and try again.

                                      1 Reply Last reply Reply Quote 0
                                      • ? Offline
                                        A Former User @Math
                                        last edited by

                                        @math I have got the same problem even after resize the partition, what i have done and worked for me :

                                        sudo ubuntu-device-flash --server=http://system-image.ubports.com touch --device=turbo --channel=ubports-touch/16.04/rc --wipe

                                        S 1 Reply Last reply Reply Quote 2
                                        • S Offline
                                          Stefano @Guest
                                          last edited by

                                          @xray2000 For me as well it was the only option.

                                          1 Reply Last reply Reply Quote 0
                                          • M Offline
                                            Mirv
                                            last edited by

                                            Noting my success details posted at https://forums.ubports.com/post/14164

                                            1 Reply Last reply Reply Quote 0
                                            • M Offline
                                              Marathon2422
                                              last edited by

                                              I have re flashed flyme 6, and downgraded to flyme 5, then flashed the unlocked bootloader,then flashed UB, some times It will not go past the UB,recovery screen, I have then flashed twrp wiped, then flash a twrp made restore of UB,then flashed UB recovery to get a working OTA,and then updated.
                                              I have done this with ch/en, flyme.

                                              I quess,adb,is not,recognized sometimes

                                              1 Reply Last reply Reply Quote 0
                                              • First post
                                                Last post