0

Is there on Linux any mount options or anything else (that I can specify in /etc/fstab) that prevent the possibility for a filesystem to be remounted via mount -o remount,... ?

For example, let's assume that I have a ramfs populated and then mount read-only by the initial RAM disk that I do not want any users (including root) to be able to remount read/write.

Thanks.

1 Answer 1

1

I am not aware of a general approach. And, of course, the question is: Whom are you defending against, a certain process or just anyone on a system even unconfined root?

In the case of ro you can make the underlying block device read-only:

blockdev --setro /dev/ram0

Of course, this just moves the question to: How do I prevent the block device from being set rw again...

1
  • The idea is to "seal" somehow that filesystem, even against unconfined root... I am not sure that it makes sense anyway... however... thanks for the hint about "blockdev --setro" and, yes, this will simply move the question... any idea about how to prevent the block device from being set rw back again? Commented Sep 10 at 14:37

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.