TechBuzzPro

How to Enable and Disable DM Verity on Android

· 5 min read · Phones & Tablets

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

DM Verity (Device Mapper Verity) is a kernel feature that verifies the integrity of the system partition on Android devices. Disabling it allows modifications like installing custom ROMs, rooting, or flashing system-level tweaks, while enabling it restores the security check. You cannot toggle it with a simple switch; it requires unlocking the bootloader and flashing a modified boot image or using fastboot commands. This guide covers the standard method using fastboot, assuming you have a device with an unlockable bootloader and the necessary tools.

What You'll Need

  • A computer with Windows, macOS, or Linux and a USB cable.
  • Android SDK Platform Tools (includes fastboot and adb) installed on your computer.
  • Your device's bootloader unlocked (this erases all data; back up first).
  • A custom recovery like TWRP installed (optional but helpful for some steps).
  • The stock boot image for your exact device model and build number (download from the manufacturer's official firmware package).
  • A tool to modify the boot image, such as magiskboot or a pre-patched boot image with dm-verity disabled (often provided by custom ROM communities).
  • USB debugging enabled in Developer Options on your phone.

Step-by-Step

  1. Back up your data. Unlocking the bootloader and flashing images will wipe your device. Copy photos, messages, and files to a computer or cloud storage.
  2. Enable Developer Options and USB debugging. Go to Settings > About phone and tap Build number seven times. Then go to Settings > System > Developer options and enable USB debugging. Menu labels may differ slightly by manufacturer and Android version.
  3. Unlock the bootloader. This step varies by manufacturer. For Google Pixel, use fastboot flashing unlock after enabling OEM unlocking in Developer options. For other brands, follow the official unlock procedure (e.g., Xiaomi requires Mi Unlock Tool). Warning: unlocking erases all user data.
  4. Install Android SDK Platform Tools on your computer and open a terminal or command prompt in that folder.
  5. Connect your phone via USB and run adb devices to confirm the computer recognizes it. Authorize the connection on your phone if prompted.
  6. Reboot to bootloader: run adb reboot bootloader. The screen will show the bootloader interface.
  7. Obtain a boot image with dm-verity disabled. You can either download a pre-patched boot image for your device from a trusted custom ROM source, or patch the stock boot image yourself using magiskboot: extract the image, edit the fstab to remove the verity flag, and repack. This is advanced; many users opt for a pre-made image.
  8. Flash the modified boot image: run fastboot flash boot patched_boot.img (replace with your file name). Ensure you are flashing the correct partition; some devices use init_boot instead of boot on newer Android versions.
  9. Reboot the device: run fastboot reboot. The system should now boot with dm-verity disabled. You may see a warning about the bootloader being unlocked; this is normal.
  10. To re-enable dm-verity, flash the original stock boot image back using the same fastboot command, then reboot. The integrity check will be restored, but you will lose any system modifications that required dm-verity to be off.

Common Mistakes

  • Flashing the wrong boot image. Using an image from a different model or build can brick your device. Always match the exact firmware version.
  • Forgetting to unlock the bootloader. Fastboot will refuse to flash if the bootloader is locked.
  • Not disabling verity before rooting. If you root without disabling dm-verity, the device may fail to boot or enter a bootloop.
  • Using outdated platform tools. Older fastboot versions may not support newer devices; always download the latest SDK Platform Tools.
  • Skipping the backup. Unlocking the bootloader wipes all data; there is no way to recover it afterward.

Tips

  • Keep a copy of your stock boot image in a safe place so you can restore it if something goes wrong.
  • Use a USB cable that supports data transfer, not a charge-only cable.
  • If you are unsure about patching the boot image yourself, look for a pre-patched image from a reputable custom ROM thread for your device.
  • After disabling dm-verity, some banking apps and Google Pay may stop working due to SafetyNet/Play Integrity checks. You may need to use Magisk Hide or similar modules to pass.
  • Always verify the checksum of downloaded files to ensure they are not corrupted.

Troubleshooting

Device stuck in bootloop after flashing: Reflash the stock boot image to restore the device. If that fails, you may need to flash the full stock firmware using fastboot or the manufacturer's recovery tool.

Fastboot does not detect the device: Ensure USB debugging is enabled, try a different USB port or cable, and install the correct USB drivers for your device on Windows. On macOS or Linux, you may need to set up udev rules.

Flashing fails with "remote: not allowed": The bootloader is still locked. Recheck the unlock procedure for your device.

System boots but Wi-Fi or cellular does not work: This can happen if the boot image is incompatible. Revert to stock and try a different patched image.

Cannot re-enable dm-verity: Ensure you are flashing the exact stock boot image for your current build. If you have taken an OTA update, the boot image may have changed; download the matching firmware.

Frequently Asked Questions

What does disabling dm-verity actually do?

It turns off the kernel's integrity check on the system partition, allowing you to modify system files (like rooting) without the device refusing to boot.

Can I disable dm-verity without unlocking the bootloader?

No. Flashing a modified boot image requires an unlocked bootloader. There is no official way around this.

Will disabling dm-verity void my warranty?

Unlocking the bootloader typically voids the warranty on most devices. Check your manufacturer's policy.

Does disabling dm-verity affect OTA updates?

Yes. Official OTA updates may fail to install because they check for system integrity. You will need to restore the stock boot image to receive updates.

Is it safe to disable dm-verity?

It reduces security by allowing unauthorized system modifications. Only do it if you understand the risks and are comfortable with potential data loss or bricking.

Can I re-enable dm-verity after disabling it?

Yes, by flashing the original stock boot image. This restores the integrity check but removes any system modifications.