Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use mount -o bind to mount directories inside chroots, which works really well. The problem is that I'd like some of these bind-mounted directories to be read only in chroot.

Is it possible? If not - any other way to achieve it?

I was thinking about using NFS for localhost mounts, but it looks like overkill.

share|improve this question
up vote 4 down vote accepted

Accourding to this is it is possible. You do need a recent kernel.

share|improve this answer
Thanks. Mount + remount fixed it. – user13185 Apr 28 '10 at 7:51

Direct answer from the LWN article:

mount --bind /vital_data /untrusted_container/vital_data
mount -o remount,ro /untrusted_container/vital_data

Supported since Linux 2.6.26.

share|improve this answer

mount --bind /vital_data /untrusted_container/vital_data

mount -o remount,ro,bind /untrusted_container/vital_data

in the second mount you have to use "remount,ro,bind" otherwise all other instances of /vital_data will got read-only right too.

share|improve this answer
No, you don't (at least not on Linux 3.19). Where did you experience the necessity of adding the bind option? – Karl Richter Feb 12 '15 at 7:14

In Squeeze it used to work with only:

mount --bind /src /dst


mount -o remount,ro /dst

Now in Debian Wheezy you have to do:

mount -o remount,ro,bind /dst

to get rid of the: resource busy message.

share|improve this answer
Thanks :) the wheezy thing saved me. – Wyatt8740 Aug 5 '14 at 21:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.