1

My USB drive is refusing to unmount:

# umount /mnt
umount: /mnt: target is busy

I believe this might be something to do with it catching up with disk caching, after some particularly intensive opperations.

  1. Is there any way to determine if this is the case. Ie: is there any way to determine why the target is busy?

  2. Assuming this is disk caching; Is there any way to find out how much is left to go, or get it to notify me when it's done?


I believe I caused this after a script speant approximately 10 hours replacing duplicate files with hard links, the 10 hours were spend removing duplicates not finding them. Immagine this on loop:

rm "$DUPLICATE"
ln "$BASE_FILE" "$DUPLICATE"

This has effectivly deleted 1.1 million files with a total of 300 GB space. In short, I've just been hammering the file system, particularly it's meta data.

  • 1
    Regarding the specifics of your question, if there’s dirty cached data waiting to be written to the drive, umount will wait for that to happen; it won’t fail with the “target is busy” message. That error means there’s something actively holding a resource on the target file system (open files, current directory, loop mounts, swap file etc.). – Stephen Kitt Aug 22 '19 at 11:48
  • @StephenKitt Okay, I'd already seen the page you linked, but on second viewing I realise I'd missed this particular answer: https://unix.stackexchange.com/a/15026/20140 . Thanks! – Philip Couling Aug 22 '19 at 11:55
  • Looks like this was mlocate. That's going to be annoying if it tries that every time I plug one of these drives in. I've just removed it. – Philip Couling Aug 22 '19 at 11:58

0 Answers0