title: Resize data partition which does not match physical storage size after installation of Android stock and Lineage
body: <p>After an attempt to install Lineageos+Magisk on a Xiaomi Mi A1, ended in a boot loop,</p>
  
  <ol>
  <li>I installed stock from <code>tissot_images_V10.0.9.0.PDHMIXM_20190514.0000.00_9.0_3ded3e7b82.tgz</code> with containing <code>flash_all.sh</code> which applies <code>fastboot</code>. I got a working starting point with a tidy a/b partitioning.  </li>
  <li>I flashed Lineage, addonsu and stock camera with a temporary (unflashed) TWRP</li>
  </ol>
  
  <p>Everything works well but there is too little storage, Lineage displays a size of <strong>32GB</strong> instead of <strong>64GB</strong></p>
  
  <p><code>df</code> tells me: <code>/dev/block/mmcblk0p49 19092180 15660496 3431684 83% /data</code></p>
  
  <p>but <code>blockdev --getsize64 /dev/block/mmcblk0p49</code> reports <code>55087439360</code> (bytes)</p>
  
  <p>I mounted the userdata.img from the stock firmware mentioned above on my Linux PC and <code>df</code> showed me</p>
  
  <p><code>/dev/loop1 19092180 118172 18762328 1% /mnt/...</code></p>
  
  <p>This seems to be the source of the problem, isn't it?</p>
  
  <p>(How) can I resize the partition / file system (preferably) without loosing data)? </p>