From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 7 21:31:00 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07C9D16A420 for ; Tue, 7 Feb 2006 21:31:00 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2E9F43D45 for ; Tue, 7 Feb 2006 21:30:55 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id k17LUkBV053555; Wed, 8 Feb 2006 00:30:46 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id k17LUjPZ053551; Wed, 8 Feb 2006 00:30:45 +0300 (MSK) (envelope-from yar) Date: Wed, 8 Feb 2006 00:30:45 +0300 From: Yar Tikhiy To: Tobias Roth Message-ID: <20060207213045.GG19674@comp.chem.msu.su> References: <20060205215628.GC26342@droopy.unibe.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060205215628.GC26342@droopy.unibe.ch> User-Agent: Mutt/1.5.9i Cc: freebsd-hackers@freebsd.org Subject: Re: md access permissions during early boot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2006 21:31:00 -0000 On Sun, Feb 05, 2006 at 10:56:28PM +0100, Tobias Roth wrote: > I am working on an rc.d/ script that creates a memory file-backed > memory disk via mdconfig (the file exists already and contains a > valid ffs). After md creation, the device is checked with fsck_ffs -p. > However, fsck fails with the error NO WRITE ACCESS. The file > permissions of the md device under /dev/ are 640, which should not > prevent access. The same is true for the file itself, and the path > to it. > > I tried passing the -o noreadonly option to mdconfig, but that didn't > result in any different behaviour. > > My script is running right after the fsck script itself. When I > run it from the command line after successful boot and login, > fsck does not fail, so somewhere between the early beginning of > the rc.d/ sequence (right after fsck is run) and login, something > changes which results in root having access to my md. A thing to check is whether the filesystem the file is on is mounted read-write by the time your script is invoked. If your script runs right after fsck, there should be only the root fs mounted, read-only. > Any ideas what that could be? Another hint is that some time > around 5.3, this was not the default behaviour, fsck was possible > back then. I am using 6.0 stable now. The ordering of your script relative to other rc.d scripts could have changed. Your script should specify rcorder(8) keywords to start at the right moment. -- Yar