LX0-103 · Question #7
Which of the following is correct when talking about mount points?
The correct answer is A. Every existing directory can be used as a mount point.. In Linux, any existing directory, regardless of whether it is empty, can be used as a mount point.
Question
Which of the following is correct when talking about mount points?
Options
- AEvery existing directory can be used as a mount point.
- BOnly empty directories can be used as a mount point.
- CDirectories need to have the SetUID flag set to be used as a mount point.
- DFiles within a directory are deleted when the directory is used as a mount point.
How the community answered
(28 responses)- A93% (26)
- C4% (1)
- D4% (1)
Why each option
In Linux, any existing directory, regardless of whether it is empty, can be used as a mount point.
The Linux kernel imposes no restriction on using a non-empty directory as a mount point; the only requirement is that the path exists and is a directory. When a filesystem is mounted over a non-empty directory, the original contents are temporarily hidden and inaccessible until the filesystem is unmounted, but they are not harmed.
Using an empty directory is best practice to avoid hiding existing files, but it is not a technical requirement enforced by the kernel or mount command.
The SetUID permission flag has no relationship to mount point eligibility; it is used to execute files with the owner's privileges.
Files inside a directory used as a mount point are not deleted; they are simply hidden while another filesystem is mounted over that directory and reappear after unmounting.
Concept tested: Linux mount point directory requirements
Source: https://linux.die.net/man/8/mount
Topics
Community Discussion
No community discussion yet for this question.