XK0-004 · Question #215
A Linux administrator needs to remove a USB drive from a system. The unmount command fails, stating the device is busy. Which of the following commands will show the reason for this error?
The correct answer is D. lsof | grep /mnt/usb. Kill the processes using the filesystem and then unmount it. The following command finds out the processes accessing the partition/filesystem. You need to run the following command as root. Here, we use the mount point /mnt/data as an example. # lsof | grep '/mnt/data' It will ou
Question
A Linux administrator needs to remove a USB drive from a system. The unmount command fails, stating the device is busy. Which of the following commands will show the reason for this error?
Options
- Alsusb | grep /mnt/usb
- Bmount | grep /mnt/usb
- Cps aux | grep /mnt/usb
- Dlsof | grep /mnt/usb
How the community answered
(26 responses)- A4% (1)
- B4% (1)
- C12% (3)
- D81% (21)
Explanation
Kill the processes using the filesystem and then unmount it. The following command finds out the processes accessing the partition/filesystem. You need to run the following command as root. Here, we use the mount point /mnt/data as an example. # lsof | grep '/mnt/data' It will output lines like bash 17622 user1 cwd DIR 253,2 4096 2 /mnt/data If you are sure that it is safe to kill the process, you may kill them by kill or kill -9. After the processes are killed, the filesystem will be able to be unmounted.
Topics
Community Discussion
No community discussion yet for this question.