The error umount: /mnt/system: target is busy
typically occurs when there are still active processes or files using the mount point, preventing it from being unmounted. Here’s how to address this issue:
Steps to Resolve the “Target is Busy” Error
- Check for Active Processes Using the Mount Point Use the
lsof
(List Open Files) orfuser
command to identify any processes that might be using the mounted filesystem:lsof +D /mnt/system
orfuser -m /mnt/system
This will list any processes using the/mnt/system
directory. If you find any, you can either stop the processes or forcefully terminate them. - Kill Processes (If Needed) If there are any processes using the mount point, you can kill them. For example, to kill a specific process:
kill -9 <PID>
Or to kill all processes using the mount:fuser -km /mnt/system
- Retry Unmounting Once the processes have been killed, try unmounting again:
umount /mnt/system
- Lazy Unmount (If the Above Steps Fail) If the above methods do not work, you can try using a “lazy” unmount, which will detach the mount when it’s no longer busy:
umount --lazy /mnt/system
- Check for Mounted Filesystems After unmounting, verify that all filesystems have been unmounted:
mount | grep /mnt/system
- Reboot if Necessary If the filesystem still cannot be unmounted, and it’s safe to do so, reboot the system. Rebooting can help clear any lingering processes holding the mount point:
reboot