For a project requirement I am trying to resize the memory partition on userdata (/data filesystem) to create a new file system. I am using parted on the device. When I tried to use resize command in parted mode for /data memory block, I am unable to do so because it is used by default in the device.

Error obtained : Error: Partition /dev/block/mmcblk0p4 is being used. You must unmount it before you modify it with Parted.

As this is /data folder I am unable to unmount it. When I tried to unmount I am getting following error.

umount /data failed: Device or resource busy

I tried killing all the processes using this folder using lsof command. However, this contains all apps data so killing all those processes reboots device.

Can somebody help me ways to resize these partition? I need commands only through adb as I am trying to create an automatic script for this.

  • 3
    You can only resize it in recovery.
    – iBug
    Sep 27 '17 at 13:12

If you want to modify any partition, reboot into a custom recovery.

Most partitions are in use whenever a normal system is running. You can't play around with them unless you are in an alternative system, like recovery.

BTW, almost anything that runs OK in Android also runs well in recovery, so simply go ahead.

Can you resize C:\ in Windows without rebooting?

  • I am not able to get into recovery mode using adb reboot recovery. Sep 27 '17 at 13:25
  • Reboot to bootloader then flash a new one with fastboot.
    – iBug
    Sep 27 '17 at 13:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.