backup a partition data to a file and retore the partition

1 adb shell 

2 su

3 cat /proc/partitions ----to get all the  partitions for the hardware emmc device.

4 dd if=/dev/block/mmcblk0p<n>of=/data/abc.img //save the partition data to a abc.img

5 adb pull /data/abc.img .

6 adb reboot bootloader

7 fastboot flash partition_abc adb.img

8 fastboot reboot

9 adb shell mount -t file_type( ext4)  partition_abc /abc  ---this step maybe done by the init.rc 




ps:

 make_ext4fs /partition_abc  to format this partition to ext4 file system

 you should work in the root mode.

你可能感兴趣的:(backup,mount,restore,a,Par,make_ext4fs)