George Hartzell wrote:
> Daniel Lang writes:
>  > Hi George,
>  > 
>  > George Hartzell wrote on Sat, Jan 25, 2003 at 06:38:07PM -0800:
>  > [..]
>  > > open("/dev/ad0", 1)', and 'call open("/dev/ad0", 2)' made it clear
>  > > that anything that would write to the disk was failing.
>  > [..]
>  > >   disklabel: /dev/ad0s2: Operation not permitted
>  > [..]
>  > > So, my questions are:
>  > > 
>  > >   1) does this ring a bell with anyone?
>  > > 
>  > >   2) Is there something in 5.0 that requires special magic to write to
>  > >      the raw disk devices?
>  > >
>  > You need to run in securelevel < 1.
>  > 
>  > Check "sysctl kern.securelevel", and read init(8).
>  > 
>  > I guess you have some rc.conf entry that raises
>  > your securelevel, most probably resulting from the sysinstall.
> 
> That's not it, 
> 
>   kern.securelevel is -1
> 
> and this is in /etc/rc.conf
> 
>   kern_securelevel_enable="NO".
> 
> Any other thoughts?
> 
> g.

Yes, this is a not-quite-yet resolved side effect of GEOM that is due to be
fixed any minute now.  Geom is overly protective when partitions are open
and mounted.  For example, if ad0s1a is open, you cannot open ad0s1 or ad0
for read/write since they overlap the ad0s1a device which has an exclusive
lock on it. This is a problem for installing boot code like you were trying
to do at the start of the thread.  The old partition code had some huge
holes in it that meant it was really easy to do bad things, and over time
things started taking advantage of it.

There are several things you can do.

1) Boot off floppy or fixit cdrom or something and fix it.
2) use the NO_GEOM kernel compile option
3) Or try this hack: ftp://ftp.jurai.net/users/winter/patches/geom-foot.patch
   This adds a kern.geom.allow_foot_shooting sysctl.

#3 is the most useful option at the moment because it enables you to turn on
the sysctl and do the update, but still give GEOM a good workout and test
in the real world.  It is new in 5.0 and it would be nice to get every bit of
real-world testing possible.  NO_GEOM is fairly likely to not be in 5.1,
so we need to get any more suprises found and taken care of.

If you are feeling like some excitement, talk with [EMAIL PROTECTED] and see
if he has patches for adding disklabel bootcode write support in a usable
state for testing yet.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to