From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Drake Subject: Re: Remount root RO after the root dentry drops from the namespace Date: Wed, 18 Nov 2009 12:38:32 +0000 Message-ID: <1258547912.2761.46.camel@localhost.localdomain> References: <1258542722.2761.40.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Miklos Szeredi Return-path: Received: from mail-bw0-f227.google.com ([209.85.218.227]:39001 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbZKRMia (ORCPT ); Wed, 18 Nov 2009 07:38:30 -0500 Received: by bwz27 with SMTP id 27so1056681bwz.21 for ; Wed, 18 Nov 2009 04:38:35 -0800 (PST) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2009-11-18 at 12:50 +0100, Miklos Szeredi wrote: > You can easily make a directory a root of a mount with > > mount --bind $DIR $DIR > > In your example, add this before 5. Thanks for the suggestion! And following on from that, we would do "mount -o remount,ro /path/to/realroot" during shutdown where /path/to/realroot is the bind mount that we created based on your advice? Unfortunately, that approach doesn't solve the problem. If you remount a bind-mount as read only then the "real" underlying mount is unaffected. See the code flow in do_remount() : if (flags & MS_BIND) err = change_mount_flags(path->mnt, flags); else err = do_remount_sb(sb, flags, data, 0); Any other ideas? Thanks, Daniel