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
More on Storage & Memory
How do you list disks, partitions and filesystems?IntermediateMBR vs GPT partition tables?IntermediateWalk through adding a new disk and mounting it permanently.IntermediateExplain the six fields of an /etc/fstab line.IntermediateWhy use UUIDs and `nofail` in fstab?IntermediateWhat does a bad fstab entry do, and how do you recover?Advanced