unmount a busy drive
"target is busy": something still uses the drive. Find it, stop it, then unmount.
Steps
-
sudo lsof +f -- /mnt/pointthe open files on it, and their programs
-
sudo fuser -vm /mnt/pointthe programs using it
-
cd ~your own shell may be the one inside it
-
sudo umount /mnt/pointunmount it
-
sudo umount -l /mnt/pointlazy: detach it now, finish when nothing uses it
Commands used
lsoffuserumount
Each has a page in lore: lore lsof opens it.
Related recipes
- create a large fileMake a file of a given size, for testing disks, uploads or swap.
- disk full but df says there is room"No space left on device" with free gigabytes: the disk is out of inodes, the slots for files. Find the folder with too many small files.
- find big filesFind the files that take the most room, on a whole disk or in a folder.
- free disk spaceFind what fills a disk, then clear what is safe to clear: old package files, logs, caches.