LX0-103 · Question #61
After running the command umount /mnt, the following error message is displayed: umount: /mnt: device is busy. What is a common reason for this message?
The correct answer is B. A user has a file open in the /mnt directory.. The 'device is busy' error from umount occurs when a process holds an open file handle or has its working directory inside the mount point.
Question
After running the command umount /mnt, the following error message is displayed:
umount: /mnt: device is busy. What is a common reason for this message?
Options
- AThe kernel has not finished flushing disk writes to the mounted device.
- BA user has a file open in the /mnt directory.
- CAnother file system still contains a symlink to a file inside /mnt.
- DThe files in /mnt have been scanned and added to the locate database.
- EThe kernel thinks that a process is about to open a file in /mnt for reading.
How the community answered
(22 responses)- A5% (1)
- B82% (18)
- D9% (2)
- E5% (1)
Why each option
The 'device is busy' error from umount occurs when a process holds an open file handle or has its working directory inside the mount point.
The kernel flushes disk writes independently of open file handles; pending writes alone do not cause a 'device is busy' error.
When a user or process has a file open within /mnt, the kernel maintains an active reference to the block device backing that filesystem. The umount syscall requires that no processes hold open file descriptors, memory-mapped files, or current working directories within the mount point before it can safely detach the filesystem.
Symlinks in other filesystems pointing into /mnt do not create active kernel references to the mounted device itself.
The locate database scanner (updatedb) may briefly open files, but once it finishes, no reference remains; a completed scan does not keep the device busy.
The kernel does not preemptively block umount based on anticipated future opens; only current active references cause this error.
Concept tested: Linux umount failure due to active file references
Source: https://man7.org/linux/man-pages/man8/umount.8.html
Topics
Community Discussion
No community discussion yet for this question.