Unable to do mdconfig(8) early in boot

Kevin Oberman oberman at es.net
Tue Aug 23 16:46:11 GMT 2005

> Date: Tue, 23 Aug 2005 08:39:28 +0200
> From: Tobias Roth <roth at iam.unibe.ch>
> On Mon, Aug 22, 2005 at 03:27:45PM -0700, Kevin Oberman wrote:
> > I just updated my current system which had last been updated about
> > Aug. 7. Suddenly profile.sh fails to run because mdconfig is returning
> > an error:
> > mdconfig: ioctl(/dev/mdctl): Read-only file system
> > 
> > It looks like it is not writable until after root is done. Why?
> I haven't had time to try profile.sh on current, so I did't run into
> this problem yet. Can you pinpoint on which of the mdconfig or mdmfs
> statements this is happening?

It is the vnodeloopback="`mdconfig -a -t vnode -f ${profile_prefix}/${loc}...
line at about line 208. I booted up in single-usr and it fails. I do
'rc.d/fsck start' and it fails. (This is where it normally runs.) I then
do 'rc.d/root start' and it succeeds, so -current wants root to be
mounted R/W. (That is all rc.d/root does.)
> > Right now, profile.sh requires fsck and must be run before root. It
> > seems that starting it after root and before mountcritlocal works, but
> > there may be some subtleties that I am missing that makes this a bad
> > idea.
> I think moving it after root would work. The only reason it is before
> root is that it historically was put as early as possible in the rcorder
> chain, so that it gets maximum control over the boot process. Only later
> it was moved after fsck to avoid problems that showed up after an
> unclean shutdown. The reason it is between fsck and root should be
> interpreted as "after fsck, but as early as possible", and not "after 
> fsck, and before root".

I have after root and before mountcritlocal and it is working fine. I'd
really want it before mounting devices so that I could use different
fstabs in different profiles, so before mountcritlocal does the job.

> > Is the inability to create an md device before root has run a problem or
> > something expected? 
> I'd like to investigate this before having profile.sh executed after root
> as default. After all, it is supposed to work on read-only root devices,
> and the behaviour you experienced may be a bug in profile.sh.
> As a side note, how is profile.sh running on -CURRENT? I had a lot of
> problems with 6.1BETA: dhclient issues, problems with hangs due to
> unexpected nic status changes. But then, I not only updated to 6 at
> that time, I am also using a different laptop with a different nic
> (before: fxp, now: bge). I'll try updating to BETA2 to see if this
> improves anything.

Beta1 had some nasty DHCP issues depending on which interface you were
using. Sam has done a lot on both dhclient and patching the more popular
drivers and it's working much better for me (wi, fxp). Try Beta3 (should
be out today, I hope) and I think it will be OK, although there may be
some work required on suspend/resume.
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman at es.net			Phone: +1 510 486-8634

More information about the freebsd-current mailing list