A question about Android recovery disk image and partitions In this video, the host is trying to modify an existing TWRP disk image file and flash the modified image in his Moto G. What surprised me is the content of that TWRP recovery image. The video shows the contents of the TWRP recovery image as:


zImage (Kernal) 
initrd.img (initial ramdisk)


How is that possible? I was under the impression that the kernel and the initial ramdisk reside in the /boot partition. He simply booted the image without giving any partition argument for fastboot:

sudo fastboot boot &lt;recovery.img&gt;


So, where would that disk image file go? /boot or /recovery? Flashing the kernel and its ramdisk (with init.rc script) into the boot partition makes sense, but I am confused because he was working with a recovery disk image, which he should have flashed into the /recovery partition. Does the recovery image also have its own kernel and ramdisk? I tried to download and see the contents of an Android recovery disk image by myself, but I couldn't open the .img file in Windows.
fastboot boot does not perform a flash.  From fastboot help:

usage: fastboot [ &lt;option&gt; ] &lt;command&gt;

commands:
  [...]
  flash &lt;partition&gt; [ &lt;filename&gt; ]             Write a file to a flash partition.
  [...]
  boot &lt;kernel&gt; [ &lt;ramdisk&gt; [ &lt;second&gt; ] ]     Download and boot kernel.



  Does the recovery image also have its own kernel and ramdisk?


Yup.  Recovery is essentially a miniature OS and boots similarly to the main boot image.