Below is a quick “cheat-sheet” you can paste into the TWRP Terminal (Advanced ➜ Terminal) before you run the ROM installer or parted/sgdisk commands.
The goal is to make absolutely sure that nothing under /system is still in use, otherwise you get the well-known
Parted: Unable to update partition table – /system (device busy)
error.
- Un-mount everything that could keep Super/System busy
# Some devices still use /system, newer ones use /system_root
# (Dynamic/Super partitions break /system up into system, vendor, product …)
for p in system system_root vendor product odm my_product; do
umount "/$p" 2>/dev/null
done
# For dynamic partitions, logical partitions are mapped with dm-mapper.
# Remove them so the block device is really idle.
dmsetup ls | awk '/system|vendor|product|odm/ {print $1}' | \
while read map; do dmsetup remove "$map"; done
# Just in case TWRP itself mounted system read/write:
twrp unmount system 2>/dev/null
twrp unmount vendor 2>/dev/null
twrp unmount product 2>/dev/null
sync
If you prefer the GUI:
TWRP Home ➜ Mount ➜ UN-tick System, Vendor, Product, ODM, etc.
Then go to Home ➜ Reboot ➜ Recovery (to reload TWRP without re-mounting System).
- (Optional) Re-mount System read-only, if you actually need it
Most ROM flash scripts will mount what they need themselves, so you usually skip this.
If you really have to mount it for manual work, do it read-only so you don’t lock the device later:
# Example for a dynamic-partition device
mkdir -p /system_root
mount -o ro -t ext4 /dev/block/mapper/system /system_root
Older (non A/B) devices:
mount -o ro -t ext4 /dev/block/bootdevice/by-name/system /system
- Run your installer / parted / sgdisk
Now run the ROM’s update-binary, parted, sgdisk, or whatever tool you were using.
Because /system and friends are no longer mounted, the partition table can be rewritten without hitting the “device busy” error.
- After flashing, re-mount (if you really need to look inside)
twrp mount system # or use the Mount menu again
Extra tips
• In TWRP Settings you can tick “Mount system partition read-only” so it never auto-mounts RW.
• If you always flash via fastboot flash super super.img in bootloader mode, the problem never occurs (nothing is mounted in fastboot).
• Don’t forget to sync after big write operations before rebooting.
That’s it! With the partitions completely un-mounted, the “device busy” message disappears, and your OS installation or partition resize goes through cleanly.