Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2002 22:59:57 -0500
From:      Brian Dean <bsd@bsdhome.com>
To:        "Clark C . Evans" <cce@clarkevans.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: read-only root partition?
Message-ID:  <20020228225957.C22566@neutrino.bsdhome.com>
In-Reply-To: <20020228012649.A23259@doublegemini.com>; from cce@clarkevans.com on Thu, Feb 28, 2002 at 01:26:49AM -0500
References:  <20020227175541.A17132@doublegemini.com> <20020228003540.V39476-100000@nohow.demon.co.uk> <20020228012649.A23259@doublegemini.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 28, 2002 at 01:26:49AM -0500, Clark C . Evans wrote:
> 
> | http://people.freebsd.org/~bsd/cdroot/
> 
> Ok.  I've tried this route and it seems to be working,
> thank you all so much for your help and pointers.

Whoops, sorry.  I just replied to your earlier mail mentioning these
scripts, but I see now that you've already found them.  I really
should read everything through before responding.

> During burning the iso image, I get a message to my 
> console,  PREVENT_ALLOW - ILLEGAL REQUEST asc=64 ascq=0 error=04
> this occurs as burncd is "fixing".

I've never seen that before so I don't know.

>   acd0: CD-RW <...>
>   Mouning from root iso9660:cd0a
>   no such device 'cd'
>   setrootbyname failed
>   iso_mountroot: can't find rootvp
>   Root mount failed: 6
>   Mounting root from iso9660:acd0

This is harmless ... the startup code is doing a boot -C which
instructions the kernel to mountroot from the CD drive.  It first
tries the scsi drive (cd0a), but not being there it failed, but then
moves on to the IDE cd drive (acd0) and succeeds.

> I also see a few drives complaining (like the mouse), 
> I think I know how to re-do the kernel to leave out
> the mouse driver though.  Is this a cd driver that
> needs to be removed?

I'm not sure what you mean by this question.  If your asking if the CD
should be removed, the answer is no.  In fact, you won't be able to
eject the CD while the system is running because it is mounted at the
root, and its not possible to unmount /.  To eject and switch to a new
cd, do a 'halt', wait until you get the message that says you can
press any key to reboot, then eject.

> Anyway, I log-in and everything works nicely.  Cool.
> Given that I've gotten this far with cdroot, I think
> I'm going to stick with this solution... and figure
> out how it works.   This kit makes three mfs for me: 
> tmp, var, etc, dev.   I'm wondering if the etc 
> and dev must be done as mfs?

I guess technically, /etc does not.  However, one feature of this
method (as I described in my earlier mail that I sent not knowing
you'd gotten this far) is that you can provide override files from a
floppy disk.  You wouldn't be able to do this if its not rw.

/dev needs to be rw.

> My next step is to make a custom boot process:
> 
>  1. Check to see if /dev/ad0s1b exists and is a
>     swap partition, if so, load it.
> 
>  2. Check to see if /dev/ad0s1? exists and is
>     a FreeBSD partition.  If so, see if it looks
>     like a /tmp, /var, or /home partition.  If
>     so mount as appropriate.
> 
>  3. Modify (2) above, to search on /ad?s1? for
>     a similar structure.  If so, then mount it
>     using vinum.
> 
> If steps 1-3 above fail, then assume it is an
> "uninitialized" box.  Ask the user to verify
> this fact, and then create the partitions 
> automagically.   If there are two disks, ask
> the user if a software mirror is to be used,
> if so, then configure this as well.

All of these are doable and could reasonably go into the file that I
used to replace /etc/rc (rc.replacement, which gets installed as
/etc/rc on the CD).  Take a look at rc_hook variable in rc.replacement
(set this in /etc/rc.conf on the CD or on the floppy /etc/rc.conf).
This may be a good way to hook in your customizations.

As far as how to do what you want regarding the local disk, you could
simply run disklabel -r on ad0s1 and look at what partitions are
there.  In the CD based root, you have a full /usr/bin worth of tools
to work with very early on in the boot process.  #1 should be pretty
simple, just grep for it and if it is there issue a swapon.

For #2, you could mount each one in turn on /mnt, and do a spot check
for some "identifying" files or directories that would likely be in
/usr, or /var, or whatever.  Once you find a match, then unmount it
from /mnt and remount it where it should go.

I don't use vinum, so I'm not sure about #3, but that should probably
be similar.

These are just a few suggestions.  I'm sure there are many ways to
implement what you are wanting.

Good luck!

-Brian
-- 
Brian Dean
bsd@FreeBSD.org
bsd@bsdhome.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020228225957.C22566>