質問

The problem statement is this: I have a directory which is configured as a mountpoint for a SAN partition. Now this SAN partition gets mounted several minutes after boot due to some reasons which I cannot avoid. In the meantime, some processes start writing to the directory (which is still not on SAN and just a local directory), thereby causing trouble.

My goal is to ensure that I do not allow any process to write in the directory while it is local. As soon as SAN gets mounted on it, the processes are free to write.

役に立ちましたか?

解決

Make the mount point immutable:

# chattr +i /mnt/foo

Verify that you cannot write there:

# touch /mnt/foo/hello
touch: cannot touch ‘/srv/test/foo’: Permission denied

And now perform the mount:

# mount /dev/foo /mnt/foo
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top