Last active
December 12, 2015 08:48
-
-
Save caplio/4746395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################# | |
# | |
# usage : dd.sh <number of pertitions> | |
# | |
# ex) $ dd.sh 38 | |
# | |
############################################# | |
# start count | |
c=0 | |
# end count | |
n=$1 | |
# output dir | |
output=/mnt/sdcard/ext_sd/images | |
if [ $# -eq 0 ] | |
then | |
echo "set count number" | |
else | |
adb shell mkdir $output | |
while [ $n -ge $c ] | |
do | |
echo "start dd to image `date`" | |
echo "if=/dev/block/mmcblk0p$c of=$output/mmcblk0p$c.img" | |
adb shell "su -c dd if=/dev/block/mmcblk0p$c of=$output/mmcblk0p$c.img bs=2048" | |
c=`expr $c + 1` | |
echo " end -----------------" | |
done | |
echo "" | |
echo "downloading dd image from $output" | |
adb pull $output/ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment