You want to unmount a disk and Linux answers umount: /mnt/data: target is busy. A program still uses something on it: it has a file open, or its current folder is there, perhaps even your own SSH window. Two commands show which program it is. The commands were tested on Ubuntu 26.04 LTS; run them as root.
1. Who Uses It: fuser
fuser -vm /mnt/data
An example, with a disk on /mnt/kb-busy:
USER PID ACCESS COMMAND
/mnt/kb-busy: root kernel mount /mnt/kb-busy
root 72044 ..c.. bash
root 72045 ..c.. sleep
root 72047 f.... tail
- PID: the number of the program.
- ACCESS
c: the program's current folder is on the disk, typically a shell that was started there withcd. - ACCESS
f: the program has a file open there.
2. Which File: lsof
lsof +f -- /mnt/data
The same example, shortened to the important columns:
COMMAND PID USER FD TYPE NAME bash 72044 root cwd DIR /mnt/kb-busy tail 72047 root 6r REG /mnt/kb-busy/file.txt
cwd is the current folder; a number such as 6r is an open file, read (r) or written (w).
3. Free It
- Your own shell:
cdback to your home folder, in every SSH window. - A service, for example a torrent client or Docker container that uses the disk: stop it the normal way, for example
systemctl stop qbittorrent-nox@alexordocker compose stop. - A program you started yourself: end it, or as a last resort
kill 72047with its PID. Look at the name first: do not end programs you do not know.
Then run umount /mnt/data again. It works once no program uses the disk any more.
umount -l hides the disk at once but keeps it in use in the background. Programs can still write to it. Find and end the user instead.
More about disks: How to Use Additional Disks on a Linux Server. A service that keeps a folder busy: Keep a Program Running on Linux.