Jump to content

android terminal emulator dd to SD card system backup


Recommended Posts

Guest opensauce
Posted

Back in 2012 I was involved in telechips device ROM mods and YAFFS file system.

I attach android terminal partition output

post-1051697-0-76262200-1421359737_thumb

post-1051697-0-72472700-1421359759_thumb

Guest opensauce
Posted

/dev/block/platform/intel/by-label/system /system ext4 ro,seclabel,nosuid,nodev,relatime,data=ordered 0 0

Just need to figure out dd to SD card

Guest glossywhite
Posted

The problem here is a "catch 22" - you need root to execute "dd" command to backup the partitions, but if you've rooted, you're therefore not backing up unmodified partitions. I'm not (yet) sure how you'd get around that, unrooted.

Guest opensauce
Posted (edited)

The problem here is a "catch 22" - you need root to execute "dd" command to backup the partitions, but if you've rooted, you're therefore not backing up unmodified partitions. I'm not (yet) sure how you'd get around that, unrooted.

 

That is a non issue, basically if you remove any gmail accounts and only backup system image you create a modified sys image.

this if correct can be flashed as customised system.(super su can unroot at push of button)

 

the part I'm unsure of is yaffs file system you specify page size, but we are ext4

Normally on yaffs the blocks would be identified with mount partition name and backed up as example

dd if=/dev/mtd/mtd2 of=/sdcard/boot.img bs=4096

I'm still uncertain how to see labels as cat /proc/mtd isn't available

 

okay i'm trying terminal as SU

cat /dev/block/mmcblk0 > /mnt/media_rw/sdcard1/mmcblk0.img

I will them compare the two and if it's pulled exact copy I can do the rest of partitions and go poking around them

 

 

fails on fat32 limitations

 

https://blog.jplitza.de/2013/07/04/external-sd-card-with-ext4-under-android-cm10-1/ as idea

 

I have full adb shell su

Edited by opensauce
Guest glossywhite
Posted (edited)

That is a non issue, basically if you remove any gmail accounts and only backup system image you create a modified sys image.

this if correct can be flashed as customised system.(super su can unroot at push of button)

 

the part I'm unsure of is yaffs file system you specify page size, but we are ext4

Normally on yaffs the blocks would be identified with mount partition name and backed up as example

dd if=/dev/mtd/mtd2 of=/sdcard/boot.img bs=4096

I'm still uncertain how to see labels as cat /proc/mtd isn't available

 

okay i'm trying terminal as SU

cat /dev/block/mmcblk0 > /mnt/media_rw/sdcard1/mmcblk0.img

I will them compare the two and if it's pulled exact copy I can do the rest of partitions and go poking around them

 

 

fails on fat32 limitations

 

https://blog.jplitza.de/2013/07/04/external-sd-card-with-ext4-under-android-cm10-1/ as idea

 

I have full adb shell su

 

Setup rsync on the device (LINK)  and on an Ubuntu box, and send it over WiFi to a share with a disk that supports >4GB, (or format a card in EXT4 (unsure if h2 supports that) and save that way. If neither of the aforementioned work, try telling "dd" to split the output stream into a set size per chunk:

http://serverfault.com/questions/205621/creating-a-80gb-image-with-dd-on-a-fat32-drive

I think you mean (as I did) block size, not page size - (ie, the final argument in the "dd" command you detailed, is "bs" or "block size" in bytes. That is crucial. The best answer is to read man pages, they never fail:

"man <command_name>" on a full Linux machine.

Edited by glossywhite
Guest PaulOBrien
Posted

What are you trying to achieve?

If you just want to back up your system, do with with busybox tar. Creates a single file, can be compressed, saves / restores permissons.

P

Guest opensauce
Posted

What are you trying to achieve?If you just want to back up your system, do with with busybox tar. Creates a single file, can be compressed, saves / restores permissons.P

Hi paul ideally a flashable img file, on previous yaffs I have managed this and able to edit,alter and reflash

Ext4 it moans about file size-previous android system images were 500-800mb.

While I have your attention teclast x98 seems to have similar bios setup, my only missgiving is screen size of flash

Posted (edited)

Although maybe a bit too late opensauce here's a list of the partition labels vs blocks: -

ls -l /dev/block/platform/intel/by-label/ | sort -t '>' -k 2.21n
l/by-label/ | sort -t '>' -k 2.21n                                            <
lrwxrwxrwx root     root              2014-01-01 00:00 reserved -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              2014-01-01 00:00 ESP -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              2014-01-01 00:00 boot -> /dev/block/mmcblk0p3
lrwxrwxrwx root     root              2014-01-01 00:00 recovery -> /dev/block/mmcblk0p4
lrwxrwxrwx root     root              2014-01-01 00:00 fastboot -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              2014-01-01 00:00 reserved_1 -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              2014-01-01 00:00 panic -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              2014-01-01 00:00 factory -> /dev/block/mmcblk0p8
lrwxrwxrwx root     root              2014-01-01 00:00 misc -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              2014-01-01 00:00 config -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              2014-01-01 00:00 cache -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              2014-01-01 00:00 logs -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              2014-01-01 00:00 system -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              2014-01-01 00:00 rom -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              2014-01-01 00:00 data -> /dev/block/mmcblk0p15

Also, backing up partitions via 'dd' to sdcard is fully functional as you've already inidicated, there's some relevant details here.

 

I'm interested to hear how you've been getting on.

 

:ninja:

Edited by Guest
Guest glossywhite
Posted

Although maybe a bit too late opensauce here's a list of the partition labels vs blocks: -

ls -l /dev/block/platform/intel/by-label/ | sort -t '>' -k 2.21n
l/by-label/ | sort -t '>' -k 2.21n                                            <
lrwxrwxrwx root     root              2014-01-01 00:00 reserved -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              2014-01-01 00:00 ESP -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              2014-01-01 00:00 boot -> /dev/block/mmcblk0p3
lrwxrwxrwx root     root              2014-01-01 00:00 recovery -> /dev/block/mmcblk0p4
lrwxrwxrwx root     root              2014-01-01 00:00 fastboot -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              2014-01-01 00:00 reserved_1 -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              2014-01-01 00:00 panic -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              2014-01-01 00:00 factory -> /dev/block/mmcblk0p8
lrwxrwxrwx root     root              2014-01-01 00:00 misc -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              2014-01-01 00:00 config -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              2014-01-01 00:00 cache -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              2014-01-01 00:00 logs -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              2014-01-01 00:00 system -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              2014-01-01 00:00 rom -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              2014-01-01 00:00 data -> /dev/block/mmcblk0p15

Also, backing up partitions via 'dd' to sdcard is fully functional as you've already inidicated, there's some relevant details here.

 

I'm interested to hear how you've been getting on.

 

:ninja:

Just to clarify, those labels are symlinked to the actual partitions. You most likely know that, I just wanted to make sure :)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.