Monday, 25 July 2016

[ROOT] Partitions backup & other partition info :



Before rooting, do backup your /boot and /system partitions via SPFT, as described here (whenever the post is filled in properly :D ) :
http://forum.xda-developers.com/r1-h...oting-t3426041
Since it's pretty tedious to run that for each and every partition, I propose to backup other ones after you get root. But note that copying the partitions back to the device is a lot quicker since all the necessary info can be preset in a scatter file !

I recommend that you follow other threads to get root, such as, for example, here :
http://forum.xda-developers.com/r1-h...-root-t3425677

Some partitions will still be mounted, but I don't think it matters that much. Anyway, here is a list of what is usually mounted :

Code:


Filesystem              Size    Used    Free  Blksize
/dev                  970.2M    84.0K  970.1M  4096
/sys/fs/cgroup        970.2M    12.0K  970.2M  4096
/mnt                  970.2M    0.0K  970.2M  4096
/mnt/runtime/default/emulated    11.2G  522.4M    10.7G  4096
/mnt/runtime/read/emulated    11.2G  522.4M    10.7G  4096
/mnt/runtime/write/emulated    11.2G  522.4M    10.7G  4096
/system                  2.5G    2.0G  516.5M  4096
/data                  11.2G  522.4M    10.7G  4096
/cache                387.4M  988.0K  386.5M  4096
/protect_f              5.8M    60.0K    5.8M  4096
/protect_s              5.8M    56.0K    5.8M  4096
/nvdata                27.5M    2.2M    25.3M  4096
/storage              970.2M    0.0K  970.2M  4096
/storage/emulated      11.2G  522.4M    10.7G  4096
/su                    90.5M  676.0K    89.8M  4096


To backup whatever partitions are out there, run these commands :

Code:


adb shell
su
mkdir /sdcard/images/
cd /sdcard/images
dd if=/dev/block/mmcblk0boot0 of=00_boot0.img
dd if=/dev/block/mmcblk0boot1 of=01_boot1.img
dd if=/dev/block/mmcblk0rpmb of=02_rpmb.img
dd if=/dev/block/mmcblk0p1 of=p1_proinfo.img
dd if=/dev/block/mmcblk0p2 of=p2_nvram.img
dd if=/dev/block/mmcblk0p3 of=p3_protect1.img
dd if=/dev/block/mmcblk0p4 of=p4_protect2.img
dd if=/dev/block/mmcblk0p5 of=p5_lk.img
dd if=/dev/block/mmcblk0p6 of=p6_para.img
dd if=/dev/block/mmcblk0p7 of=p7_boot.img
dd if=/dev/block/mmcblk0p8 of=p8_recovery.img
dd if=/dev/block/mmcblk0p9 of=p9_logo.img
dd if=/dev/block/mmcblk0p10 of=p10_expdb.img
dd if=/dev/block/mmcblk0p11 of=p11_seccfg.img
dd if=/dev/block/mmcblk0p12 of=p12_oemkeystore.img
dd if=/dev/block/mmcblk0p13 of=p13_secro.img
dd if=/dev/block/mmcblk0p14 of=p14_keystore.img
dd if=/dev/block/mmcblk0p15 of=p15_tee1.img
dd if=/dev/block/mmcblk0p16 of=p16_tee2.img
dd if=/dev/block/mmcblk0p17 of=p17_frp.img
dd if=/dev/block/mmcblk0p18 of=p18_nvdata.img
dd if=/dev/block/mmcblk0p19 of=p19_metadata.img
#dd if=/dev/block/mmcblk0p20 of=p20_system.img
#dd if=/dev/block/mmcblk0p21 of=p21_cache.img
#dd if=/dev/block/mmcblk0p22 of=p22_userdata.img
dd if=/dev/block/mmcblk0p23 of=p23_flashinfo.img
md5sum *.img
exit
exit
adb pull /sdcard/images


These are the files that you'll get

Code:


-rw-rw---- root    sdcard_rw  4194304 2016-01-01 18:31 00_boot0.img
-rw-rw---- root    sdcard_rw  4194304 2016-01-01 18:31 01_boot1.img
-rw-rw---- root    sdcard_rw        0 2016-01-01 18:47 02_rpmb.img
-rw-rw---- root    sdcard_rw  3145728 2016-01-01 18:31 p1_proinfo.img
-rw-rw---- root    sdcard_rw  5242880 2016-01-01 18:31 p2_nvram.img
-rw-rw---- root    sdcard_rw 10485760 2016-01-01 18:31 p3_protect1.img
-rw-rw---- root    sdcard_rw 10485760 2016-01-01 18:31 p4_protect2.img
-rw-rw---- root    sdcard_rw  524288 2016-01-01 18:31 p5_lk.img
-rw-rw---- root    sdcard_rw  524288 2016-01-01 18:31 p6_para.img
-rw-rw---- root    sdcard_rw 16777216 2016-01-01 18:31 p7_boot.img
-rw-rw---- root    sdcard_rw 16777216 2016-01-01 18:31 p8_recovery.img
-rw-rw---- root    sdcard_rw  8388608 2016-01-01 18:31 p9_logo.img
-rw-rw---- root    sdcard_rw 10485760 2016-01-01 18:31 p10_expdb.img
-rw-rw---- root    sdcard_rw  524288 2016-01-01 18:31 p11_seccfg.img
-rw-rw---- root    sdcard_rw  2097152 2016-01-01 18:31 p12_oemkeystore.img
-rw-rw---- root    sdcard_rw  6291456 2016-01-01 18:31 p13_secro.img
-rw-rw---- root    sdcard_rw  8388608 2016-01-01 18:31 p14_keystore.img
-rw-rw---- root    sdcard_rw  5242880 2016-01-01 18:31 p15_tee1.img
-rw-rw---- root    sdcard_rw  5242880 2016-01-01 18:31 p16_tee2.img
-rw-rw---- root    sdcard_rw  1048576 2016-01-01 18:31 p17_frp.img
-rw-rw---- root    sdcard_rw 33554432 2016-01-01 18:31 p18_nvdata.img
-rw-rw---- root    sdcard_rw 38797312 2016-01-01 18:32 p19_metadata.img
-rw-rw---- root    sdcard_rw 16777216 2016-01-01 18:32 p23_flashinfo.img


And this is another map of partitions to names :

Code:


lrwxrwxrwx root    root              2016-01-01 17:30 boot -> /dev/block/mmcblk0p7
lrwxrwxrwx root    root              2016-01-01 17:30 cache -> /dev/block/mmcblk0p21
lrwxrwxrwx root    root              2016-01-01 17:30 expdb -> /dev/block/mmcblk0p10
lrwxrwxrwx root    root              2016-01-01 17:30 flashinfo -> /dev/block/mmcblk0p23
lrwxrwxrwx root    root              2016-01-01 17:30 frp -> /dev/block/mmcblk0p17
lrwxrwxrwx root    root              2016-01-01 17:30 keystore -> /dev/block/mmcblk0p14
lrwxrwxrwx root    root              2016-01-01 17:30 lk -> /dev/block/mmcblk0p5
lrwxrwxrwx root    root              2016-01-01 17:30 logo -> /dev/block/mmcblk0p9
lrwxrwxrwx root    root              2016-01-01 17:30 metadata -> /dev/block/mmcblk0p19
lrwxrwxrwx root    root              2016-01-01 17:30 nvdata -> /dev/block/mmcblk0p18
lrwxrwxrwx root    root              2016-01-01 17:30 nvram -> /dev/block/mmcblk0p2
lrwxrwxrwx root    root              2016-01-01 17:30 oemkeystore -> /dev/block/mmcblk0p12
lrwxrwxrwx root    root              2016-01-01 17:30 para -> /dev/block/mmcblk0p6
lrwxrwxrwx root    root              2016-01-01 17:30 proinfo -> /dev/block/mmcblk0p1
lrwxrwxrwx root    root              2016-01-01 17:30 protect1 -> /dev/block/mmcblk0p3
lrwxrwxrwx root    root              2016-01-01 17:30 protect2 -> /dev/block/mmcblk0p4
lrwxrwxrwx root    root              2016-01-01 17:30 recovery -> /dev/block/mmcblk0p8
lrwxrwxrwx root    root              2016-01-01 17:30 seccfg -> /dev/block/mmcblk0p11
lrwxrwxrwx root    root              2016-01-01 17:30 secro -> /dev/block/mmcblk0p13
lrwxrwxrwx root    root              2016-01-01 17:30 system -> /dev/block/mmcblk0p20
lrwxrwxrwx root    root              2016-01-01 17:30 tee1 -> /dev/block/mmcblk0p15
lrwxrwxrwx root    root              2016-01-01 17:30 tee2 -> /dev/block/mmcblk0p16
lrwxrwxrwx root    root              2016-01-01 17:30 userdata -> /dev/block/mmcblk0p22


And mount output :

Code:


rootfs / rootfs ro,seclabel 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
/dev/fuse /mnt/runtime/default/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/runtime/read/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/runtime/write/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,resuid=10010,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect1 /protect_f ext4 rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect2 /protect_s ext4 rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered 0 0
/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/nvdata /nvdata ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
/dev/fuse /storage/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/loop1 /su ext4 rw,seclabel,noatime,data=ordered 0 0


And partition sizes in blocks:

Code:


major minor  #blocks  name

  7        0      1254 loop0
  7        1      98304 loop1
 179        0  15392768 mmcblk0
 179        1      3072 mmcblk0p1
 179        2      5120 mmcblk0p2
 179        3      10240 mmcblk0p3
 179        4      10240 mmcblk0p4
 179        5        512 mmcblk0p5
 179        6        512 mmcblk0p6
 179        7      16384 mmcblk0p7
 179        8      16384 mmcblk0p8
 179        9      8192 mmcblk0p9
 179      10      10240 mmcblk0p10
 179      11        512 mmcblk0p11
 179      12      2048 mmcblk0p12
 179      13      6144 mmcblk0p13
 179      14      8192 mmcblk0p14
 179      15      5120 mmcblk0p15
 179      16      5120 mmcblk0p16
 179      17      1024 mmcblk0p17
 179      18      32768 mmcblk0p18
 179      19      37888 mmcblk0p19
 179      20    2736128 mmcblk0p20
 179      21    409600 mmcblk0p21
 179      22  12049920 mmcblk0p22
 179      23      16384 mmcblk0p23
 179      96      4096 mmcblk0rpmb
 179      64      4096 mmcblk0boot1
 179      32      4096 mmcblk0boot0





No comments:

Post a Comment