Is there any way to backup/dump kernel image without root or twrp/cwm ?
It is possible to dump device partitions without root or custom recovery - if your device has "fastboot" mode and is boot unlocked. I'm not going to describe unlocking the boot loader, but with a fastboot device it is usually pretty easy - search the internet for instructions for your specific device.
You will need a TWRP recovery image for your device, but you don't need to actually install it on the device - we'd just temporarily boot into it to get access to the raw boot partition. Look at https://twrp.me/Devices/ and download the image for your device.
You need to find out which partition you want to backup from the device's storage. Usually there is a
by-name directory somewhere under the devices tree that lists all the operating system's partitions with names and physical partition identifiers.
- Install ADB and Fastbook command line tools.
- On your device, enable "Developer Mode" and then go into the developer settings and enable "USB debugging".
- Connect your device to your computer.
- On your computer run
adb devicesand verify your device is listed. You may need to authorize access on the device itself in a popup that will appear.
adb shellto go into the device's command line shell
find /dev -name 'by-name' 2>/dev/nullto find the
by-namedirectory. It should list one, though if there are a couple, it shouldn't be a problem and both should work.
- Take the directory name and run
ls -la <by-name-directory>(replacing the place holder with the actual directory name)
- Find the name of the partition you are interested in - if you want just the kernel, the name is
boot, or if your device has multiple slots, it is probably
boot_a- and record the physical partition path listed for it. It should be something like
/dev/block/mmcblk0p22(this is on my Mi A1 device - if you have a different one, the number after "p" will be different and possibly even the number before "p").
If you do not have a
by-name directory on your device, you might want to search the internet for the correct device name, though there are ways to detect the correct partition from within the device - comment if you need help.
Steps to Backup
- Reboot your device to the fastboot boot loader. There's usually a boot time key combination for this, on my Xiaomi Mi A1 its POWER + VOLUME-DOWN, but you can also use ADB to do that: execute
adb reboot-bootloaderto go directly to fastboot mode.
- Use fastboot to boot into the TWRP image you downloaded, without installing it on the device:
fastboot boot recovery-3.2.1-1.img. It will take a couple of minutes for the device to boot into TWRP, so be patient.
- On your computer, run
adb pull /dev/block/mmcblk0p22 boot.img, replacing "
mmcblk0p22" with the correct boot device path you found in the preparations stage, and "
boot.img" with where you actually want to save the kernel boot image.
If your device has multiple boot slots, its probably a good idea to backup both (on my device, for some reason, after a clean install and update, they are not identical).