Home/Android Rooting, Fastboot & ROM Guides/Boot.img vs Init_boot.img: Which File to Patch in Magisk?

Boot.img vs Init_boot.img: Which File to Patch in Magisk?

Do not pick boot.img just because an old tutorial uses it. Magisk's correct patch target depends on your phone's boot layout. Many newer devices have a separate init_boot.img, while others still use boot or recovery.

Boot.img vs init_boot.img: quick answer

boot.img contains boot-related data such as the kernel and, on some phones, ramdisk components. init_boot.img is a separate boot-related partition used on many newer launch devices. Magisk needs to patch the image appropriate to the exact device layout. If your firmware has an init_boot.img and official device instructions use it, do not substitute boot.img.

Magisk's official installation guide says to prepare the suitable boot, init_boot or recovery image and patch it on the device itself. Samsung follows a different package-based process.

How to find the correct Magisk image

  1. Record the exact model and installed build. Note the device codename if a ROM guide uses one.
  2. Get matching official firmware. Use the same build currently on the phone, not another region's image or a similar model.
  3. Check the firmware contents. Look for init_boot.img and boot.img in the official package. Presence alone does not replace your device's instructions.
  4. Check Magisk and device notes. Follow the current installation route for your phone, including ramdisk or recovery-based exceptions.
  5. Keep originals. Save an untouched copy of every image used. Do not use a patched image sent by another person.

Should I patch boot.img, init_boot.img or recovery.img?

  • init_boot.img: used on compatible devices whose rooting workflow targets a separate init_boot partition.
  • boot.img: used on devices with the appropriate ramdisk layout and boot-image patching workflow.
  • recovery.img: used for certain devices without boot ramdisk under Magisk's recovery installation method.
  • Samsung AP package: may be patched as a firmware archive and installed through the model's Odin workflow rather than generic Fastboot commands.

A phone's Android version alone is not a reliable way to pick one. Its original launch version and vendor design can matter. Check the model guides and the official Magisk instructions.

How to patch with Magisk

Install the authentic Magisk app, copy the matching unmodified image to the phone, choose Install > Select and Patch a File, and select the correct file. Magisk creates a patched output file. Move that file back to the PC with a known method such as adb pull.

Before flashing, check the model-specific partition command. Flashing a patched boot.img to init_boot, or the reverse, can cause startup failure. For the larger process, see how to root Android with Magisk.

What if the phone bootloops after a wrong image?

Stop flashing more random images. Record exactly what you flashed and the firmware build. Recover using matching stock firmware and the device maker's supported route. Do not relock a modified boot chain. If the bootloop started only after a Magisk module, use our Magisk module bootloop guide instead.

Boot image FAQ

Can I use an image from the same phone model but a different update?

No. Match the precise installed firmware build where the instructions require it.

Does Samsung use fastboot flash init_boot?

Most Samsung flashing workflows use Download Mode and an Odin-style package, not a generic Fastboot command.

Does patching the image itself unlock the bootloader?

No. Bootloader eligibility and unlocking are separate steps, often with a full data wipe.