5

I know there is option "--bind" for multiple mount operation to handle such case.
But ext4 can be directly mounted at different mount points, without option "--bind".
So, I wonder whether it is safe to mount ext4 filesystem at different mount points.
And I find that ext4 support a feature "mmp"(multiple mount protection), is it used to handle this case?

4
  • Why is the bind option not enough? I don't think you can mount an ext4 more than once. Commented Apr 14, 2016 at 3:48
  • bind option is enough, but I found a filesystem corrupted with double mounted at different folder. And I am not sure whether this issue is related to double mounted, since double mounted is allowed when testing in centos 7. Commented Apr 14, 2016 at 5:53
  • are you writing same files from different mount points? What are you trying to achive by mounting it in different mount points? I too have used but at one mount point i mounted it as readonly so that I am safe. Commented Apr 14, 2016 at 9:48
  • Yes, the writing same file at different mount points. But, that should make the file corrupted, not the filesystem corrupted. Commented Apr 14, 2016 at 10:36

1 Answer 1

5

Yes, it's perfectly safe. It's mentioned in the manpage for mount().

Since Linux 2.4 a single filesystem can be visible at multiple mount points, and multiple mounts can be stacked on the same mount point.

I think mmp is something else. Something about mounting a block device which is shared between multiple computers.


So it's not always been possible. IIRC it used to check for it and give you a nice error message. Because that's very easy to implement, and if it did the wrong thing, you could very easily cause massive data loss. It sounds like the new system was implemented in tandem with bind mounts:

MS_BIND (Linux 2.4 onward)

Perform a bind mount

1

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.