Subject: Re: raided1 root / installboot drives me mad
To: None <>
From: Miles Nordin <carton@Ivy.NET>
List: port-alpha
Date: 08/09/2005 08:08:54
Content-Type: text/plain; charset=US-ASCII

>>>>> "s" == sp4rc  <> writes:

     s> Why does installboot complains about a read-only file system?

Three things:

1. securelevel 1 forbids writing to the raw device that corresponds to
   a mounted partition.  If you can unmount your root filesystem, just
   copy boot to /boot, unmount it, and then run installboot.  The new
   installboot can work on unmounted filesystems.  

   Or, you can run installboot in single-user mode where securelevel
   is 0.  I think it is:

>>>boot -flags -s

   in the console, but that might not be exactly right.  Or, use '-d'
   to enter ddb on boot, and before the system mounts the root
   filesystem or configures most drivers, you'll be able to enter:

   ddb> write/l securelevel -1
   ddb> c

   it's untested, but I think that might work to stay insecure in
   multi-user, just for one boot-up.  Then you can reboot and get
   normal securelevel back.

2. sometimes you have to do:

   # sleep 90 < /dev/rsd1c &
   # disklabel -W sd1
   # installboot ...
   # disklabel -N sd1

   you may need this to newfs filesystems as well so newfs can write
   to the fsize/bsize/cpg in the disklabel.  Programs that write to
   the disklabel directly rather than using the ioctl, on some
   architectures, are prevented unless label writing is turned on with
   'disklabel -W'.  You need the sleep 90 sometimes (maybe it is just
   with pccard stuff?) because all the disk driver's state is cleaned
   up and forgotten when no process has it open any more.

3. as Simon said, the correct way is:

   # cd /usr/mdec
   # cp boot /
   # sync
   # installboot -v /dev/rsd1a bootxx_ffs /boot

   so, use bootxx_ffs as primary loader (works on FFSv1 filesystems
   only. can't use FFSv2 yet.) and not boot.  Copy boot to /boot
   before starting.  Use /dev/rsd1a instead of rsd1c (might not be

Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

Version: GnuPG v1.2.6 (NetBSD)