Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jan 1996 10:53:05 -0800 (PST)
From:      "Rodney W. Grimes" <rgrimes@GndRsh.aac.dev.com>
To:        peter@jhome.DIALix.COM (Peter Wemm)
Cc:        current@freebsd.org
Subject:   Re: Odd question.. ;-)
Message-ID:  <199601041853.KAA29761@GndRsh.aac.dev.com>
In-Reply-To: <Pine.BSF.3.91.960104213427.476A-100000@jhome.DIALix.COM> from "Peter Wemm" at Jan 4, 96 09:43:52 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Hi all..
> 
> I have a strange question..  (even stranger since it's from somebody who 
> should know.. :-)
> 
> How do I update the boot code to -current? :-)

1) fdisk sd0 | lpr		#Hardcopy so you can read it if it gets
				#trashed

2) disklabel sd0 | lpr	 	#Ditto
3) disklabel -B sd0
4) fdisk sd0			#Make sure it matches 1) above.

> 
> Last time I messed with disklabel and /usr/mdec, I ended up trashing my 
> system beyond repair..  I've not looked again in something like 12 months.

Your disk is probably partitioned so that the offset of the BSD slice
starts at sector 0 of the disk, this causes the boot1 code to overlay
the MBR when you do a disklabel -B, which causes your MBR to revert to the
compiled in one.

I have seen other replies saying that they have had no problem whatsoever
with disklabel -B, and that will be true so long as the offset of your BSD
slice is >0 sector.

For example:
******* Working on device /dev/rsd0 *******
parameters extracted from in-core disklabel are:
cylinders=511 heads=64 sectors/track=32 (2048 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=511 heads=64 sectors/track=32 (2048 blks/cyl)

Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
<UNUSED>
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 0, size 1046528 (511 Meg), flag 80
        beg: cyl 0/ sector 1/ head 0;
        end: cyl 510/ sector 32/ head 63
SkyRsh# 
SkyRsh# disklabel -B sd0
SkyRsh# fdisk sd0
******* Working on device /dev/rsd0 *******
parameters extracted from in-core disklabel are:
cylinders=511 heads=64 sectors/track=32 (2048 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=511 heads=64 sectors/track=32 (2048 blks/cyl)

Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
<UNUSED>
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 0, size 50000 (24 Meg), flag 80
        beg: cyl 0/ sector 1/ head 0;
        end: cyl 1023/ sector 63/ head 255
SkyRsh# 

Boom... there goes my partition table :-(.

> Basically, I want to install a new /usr/mdec/boot2, because this system 
> has a version 2.0.5 boot2 that has the missing LF during boot.. :-)  
> (real crisis, eh? :-)
> 
> So, what do I do?  disklabel -B sd0 ?  I think last time I did that, I 
> lost the fdisk tables...  but I dont really remember...


-- 
Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
Accurate Automation Company                 Reliable computers for FreeBSD



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