Playing with mantas

Posted on 2016-03-27 (Sun) in linux

This guide explains how to increase the size of the system partition on the Samsung/Google Nexus 10 (manta) to install bigger ROMs and GApps images. I still can’t boot CyanogenMod 13 on my device but thats another problem.

To get your stock partition table back this command should do the trick, but I haven’t testet it:

$ fastboot oem format

Better save the partition table or the parted output somewhere safe and recover from that.

This is how the partitons on my manta looked before (I have the 16GB version):

(parted) p
p
Model: MMC MAG2GA (sd/mmc)
Disk /dev/block/mmcblk0: 15758000128B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start        End           Size          File system  Name      Flags
 1      4194304B     25165823B     20971520B     ext4         efs
 2      25165824B    33554431B     8388608B                   param
 3      33554432B    50331647B     16777216B                  boot
 4      50331648B    83820543B     33488896B                  recovery
 5      83820544B    83886079B     65536B                     metadata
 6      83886080B    88080383B     4194304B                   misc
 7      88080384B    641728511B    553648128B    ext4         cache
 8      641728512B   1480589311B   838860800B    ext2         system
 9      1480589312B  15753805823B  14273216512B  ext4         userdata
  • System size is ~840MB
  • Userdata size is ~14.3GB

When you install CyanogenMod 13 you have about 200MB left on /system. Installing GApps packages with a size of 500MB+ is impossible. The only package that works is the Pico package but I wanted the Stock one.

After I changed the partition sizes I ended up with this:

(parted) p
p
Model: MMC MAG2GA (sd/mmc)
Disk /dev/block/mmcblk0: 15758000128B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start        End           Size          File system  Name      Flags
 1      4194304B     25165823B     20971520B     ext4         efs
 2      25165824B    33554431B     8388608B                   param
 3      33554432B    50331647B     16777216B                  boot
 4      50331648B    83820543B     33488896B                  recovery
 5      83820544B    83886079B     65536B                     metadata
 6      83886080B    88080383B     4194304B                   misc
 7      88080384B    641728511B    553648128B    ext4         cache
 8      641728512B   2319450111B   1677721600B   ext2         system
 9      2319450112B  15753805823B  13434355712B  ext4         userdata
  • System size is ~1.6GB
  • Userdata size is ~13.4GB

This looks way better. Installing CyanogenMod 13 and Gapps Stock worked. Only problem is that the CM13 ZIP tries to resize the filesystem on the /system partition back to it’s stock size so you have to repair that before flashing the Gapps package. Seems like the same thing happens when flashing the Gapps so just repair it after every step to be sure nothing goes wrong.

Last thing that still doesn’t work for me is the first start setup wizard. It crashes everytime so I can’t setup the device. If you have any advise how I could fix that, please tell me. I made a thread on xda for that.

You need some files for that. Here they are:

Here is the copy and paste list of commands you need. Only continue if you know what you’re doing. If you brick your device, don’t come to me crying for help.

  1. boot into fastboot mode
  2. flash latest twrp: fastboot flash recovery twrp-3.0.2-0-manta.img
  3. reboot to recovery
  4. push parted to device: adb push parted e2fsck resize2fs /tmp/
  5. open a shell: adb shell
  6. become root: su
  7. fix rights: chmod a+x /tmp/{parted,e2fsck,resize2fs}
  8. open internal storage with parted: /tmp/parted /dev/block/mmcblk0
  9. note stock sizes (p + enter)
  10. remove partition 9 (userdata)
  11. remove partition 8 (system)
  12. mkpart 8 start:641728512B end:2319450111B
  13. mkpart 9 start:2319450112B end:15753805823B
  14. exit parted
  15. format system: mke2fs -t ext2 /dev/block/mmcblk0p8
  16. format userdata: mke2fs -t ext4 /dev/block/mmcblk0p9
  17. wipe everything including system, just to be sure
  18. install cm13 zip
  19. check system: e2fsck -f /dev/block/mmcblk0p8
  20. fix filesystem size: resize2fs /dev/block/mmcblk0p8
  21. install gapps zip
  22. check system: e2fsck -f /dev/block/mmcblk0p8
  23. fix filesystem size: resize2fs /dev/block/mmcblk0p8
  24. wipe cache and dalvik
  25. reboot

I still don’t know what the cache partition is used for. Maybe it’s a good idea to also increase the size of it from ~560MB to let’s say 1.2GB. Maybe someone could tell me if this is a good idea or if it makes any sense.

To get adb working at first boot at these two lines to /system/build.prop:

persist.sys.usb.config=mtp,adb
persist.service.adb.enable=1

Now copy your adb key to the device:

adb push /home/xengi/.android/adbkey.pub /data/misc/adb/adb_keys

Don’t forget to mount the partions before copying stuff to the device.