a new hard-drive in a 2y/o laptop

Michael Powell nightrecon at hotmail.com
Sat Jan 1 00:34:11 UTC 2011


Ian Smith wrote:

> In freebsd-questions Digest, Vol 343, Issue 5, Message: 10
> On Tue, 28 Dec 2010 11:02:45 -0500 Chris Brennan <xaero at xaerolimit.net>
> wrote:
>  > On Tue, Dec 28, 2010 at 2:23 AM, Michael Powell
>  > <nightrecon at hotmail.com>wrote:
>  > 
>  > > Try zeroing out the mbr:
>  > >
>  > > Boot a LiveFS CD, then at a root prompt do:
>  > >
>  > > sysctl kern.geom.debugflags=16  and:
>  > >
>  > > dd if=/dev/zero of=/dev/adx oseek=1 bs=512 count=1
>  > >
>  > > where x equals your drive number. This will zero out any old MBR.
> 
> Er, no, Mike.  The MBR is in sector 0 of the disk; that would zero out
> sector 1 as oseek=1 skips over sector 0.  What's in sector 1 depends on
> how/whether the disk is sliced.  In a 'dangerously dedicated' (unsliced)
> disk like a memory stick perhaps, this would usually be /boot/boot1 and
> include the bsdlabel.  In a sliced disk, sectors 1 to 62 are typically
> unused, the first slice usually starting at sector 63.
> 
> t23% fdisk -s ad0
> /dev/ad0: 232581 cyl 16 hd 63 sec
> Part        Start        Size Type Flags
>    1:          63     8385867 0x0b 0x00
>    2:     8385930   125821080 0xa5 0x80
>    3:   134207010    33543342 0xa5 0x00
>    4:   167750730    66685815 0xa5 0x00
> 
> If you really want to zero out sector 0, leave out the oseek (or use
> oseek=0) - but you're better off using 'fdisk -Bi' to init a new disk.
> 

Yes - true enough. Was thinking partition table and typed 'mbr'. 

> Mmm .. it's not clear from Chris' original message exactly what he did.

In my case, a temporary replacement disk had FreeBSD 6.2 on it. Something 
changed wrt to disklabeling on the way to 8-Release and the old 6.2 being 
present created a situation where that region on the disk was invisible to 
the new labeling and wouldn't write out. A new install of 8-Release 
(sysinstall) would error out with the same message as Chris when it came to 
the point of writing out to the disk. For me, the above 2 commands fixed my 
situation. Even though his error is the same, I think his problem may be  
different from mine.

-Mike
 
[snip]




More information about the freebsd-questions mailing list