Interview Prep/Linux/Storage & Memory

Why does `umount` say "target is busy" and how do you fix it?

IntermediateConceptStorage & Memory
Answer

Some process has an open file, a working directory, or a memory map on that filesystem (often your own shell sitting in it).

sudo lsof +f -- /data
sudo fuser -vm /data
sudo fuser -km /data       # kill them (careful)
sudo umount -l /data       # lazy: detach now, clean up when no longer busy
All Linux questions Roadmap: Linux

More on Storage & Memory