1

After an attempt to install Lineageos+Magisk on a Xiaomi Mi A1, ended in a boot loop,

  1. I installed stock from tissot_images_V10.0.9.0.PDHMIXM_20190514.0000.00_9.0_3ded3e7b82.tgz with containing flash_all.sh which applies fastboot. I got a working starting point with a tidy a/b partitioning.
  2. I flashed Lineage, addonsu and stock camera with a temporary (unflashed) TWRP

Everything works well but there is too little storage, Lineage displays a size of 32GB instead of 64GB

df tells me: /dev/block/mmcblk0p49 19092180 15660496 3431684 83% /data

but blockdev --getsize64 /dev/block/mmcblk0p49 reports 55087439360 (bytes)

I mounted the userdata.img from the stock firmware mentioned above on my Linux PC and df showed me

/dev/loop1 19092180 118172 18762328 1% /mnt/...

This seems to be the source of the problem, isn't it?

(How) can I resize the partition / file system (preferably) without loosing data)?

FranMart
  • 11
  • 1
  • 2
  • After some investigations my current approach is start TWRP and obtain the image `adb pull /dev/block/mmcblk0p49 mmcblk0p49.img` resize the file system within the image to the full extent of the partition `e2fsck -f mmcblk0p49.img` `resize2fs -p mmcblk0p49.img` and write it back `fastboot flash userdata mmcblk0p49.img` Are there things I you need to take into consideration? – FranMart Nov 09 '19 at 16:05

1 Answers1

0

I found a solution for my problem. TWRP has added resize2fs to its features: https://www.theandroidsoul.com/twrp-2-8-7-0-introduces-resize2fs-feature-to-fix-incorrect-storage-space-available-on-a-device/

So I started TWRP

sudo fastboot boot twrp-3.3.0-1-tissot.img

In TWRP I launched command line and with a single command

resize2fs /dev/block/mmcblk0p49 <newsize>

the problem was solved. I did not extend to the full size of the partition but left some MBs (at the end) because I seem to remember having read that this space is necessary for meta data when encrypting the device.

FranMart
  • 11
  • 1
  • 2