In what case will you mount a filesystem in a non-empty directory?

  • Thread starter Eus
  • Start date
In summary: Hi Ho! :smile:I just wonder in what case we want to mount a filesystem in a non-empty directory.Mounting a filesystem in a non-empty directory will cause the content of the directory to be inaccessible. So, is there any good reason to do that?There is no good reason to do this, it just wastes time.
  • #1
Eus
94
0
Hi Ho! :smile:

I just wonder in what case we want to mount a filesystem in a non-empty directory.
Mounting a filesystem in a non-empty directory will cause the content of the directory to be inaccessible. So, is there any good reason to do that?

Regards,
Eus
 
Computer science news on Phys.org
  • #2
Eus said:
Hi Ho! :smile:

I just wonder in what case we want to mount a filesystem in a non-empty directory.
Mounting a filesystem in a non-empty directory will cause the content of the directory to be inaccessible. So, is there any good reason to do that?

Regards,
Eus

Two points.

1.Technically speaking, nothing is inaccessible.

2. re any good reason to do that ?... none that I can think of, other than wasting time.

Cheers

Aquafire
 
  • #3
Hi Ho!

One reason to mount a file system on a nonempty directory is when the whole content of the directory will be rendered useless with the content of the file system to be mounted. For example, a DVD contains four ISO9660 image files of four different titles of games has been mounted under /mnt/dvdrom. To play a game, the ISO9660 image of the game must be mounted first so that its content can be read. Because only one game can be played in a PC, there is no need to mount the image in another mount point. Instead, the image is also mounted under /mnt/dvdrom, hiding the file system of the DVD whose content is not needed to be directly accessible in user space. This design will also allow the use of a friendly menu by which the user can select which game to run. Since the user who executed the menu can mount the DVD under /mnt/dvdrom, the menu can also mount the selected image file under /mnt/dvdrom. This will eliminate the need of asking the user to which mount point the user has permission to mount the selected image file.


Eus
 
  • #4
Eus said:
Hi Ho! :smile:

I just wonder in what case we want to mount a filesystem in a non-empty directory.
Mounting a filesystem in a non-empty directory will cause the content of the directory to be inaccessible. So, is there any good reason to do that?

Regards,
Eus

Thats not true. Don't you ever mount file systems to your home dir? Like iso images, network shares, etc. Does the contents of your home dir then become inaccessible? No.
 
  • #5
And also why did you ask if there is a good reason if you appear to already know?
 
  • #6
octelcogopod said:
And also why did you ask if there is a good reason if you appear to already know?

Because when I asked it for the very first time (09.17.07), I didn't know the reason.
But, I encountered a case where I would like to mount a filesystem in a non-empty directory.
So, I wrote the reason here on 03.22.08 to let others know.


Eus
 

1. What is the purpose of mounting a filesystem in a non-empty directory?

Mounting a filesystem in a non-empty directory is typically done to access the contents of the new filesystem while still having the existing contents of the directory visible. This can be useful for merging or organizing files from multiple sources.

2. Is it safe to mount a filesystem in a non-empty directory?

In general, it is not recommended to mount a filesystem in a non-empty directory as it can cause confusion and potential data loss if files with the same names are overwritten. However, there are some cases where it may be necessary or beneficial to do so.

3. What are some potential drawbacks of mounting a filesystem in a non-empty directory?

One potential drawback is the risk of accidentally overwriting existing files. Another is that the mounted filesystem may not be easily accessible or visible if it is mounted on top of an existing directory.

4. Can I mount multiple filesystems in the same non-empty directory?

No, it is not possible to mount multiple filesystems in the same non-empty directory. Only one filesystem can be mounted in a directory at a time.

5. How do I safely mount a filesystem in a non-empty directory?

If it is necessary to mount a filesystem in a non-empty directory, it is important to make sure that the existing directory contents are backed up and that there are no potential conflicts with file names. It is also recommended to use the "bind" option when mounting to preserve the existing contents of the directory.

Similar threads

  • Computing and Technology
Replies
18
Views
1K
Replies
14
Views
2K
  • Programming and Computer Science
Replies
9
Views
2K
  • Computing and Technology
Replies
9
Views
2K
  • Computing and Technology
Replies
22
Views
5K
  • Programming and Computer Science
Replies
19
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
Replies
1
Views
620
  • Optics
Replies
5
Views
6K
Replies
17
Views
2K
Back
Top