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

Ian Smith smithi at nimnet.asn.au
Sun Jan 2 07:19:20 UTC 2011

On Sun, 2 Jan 2011 01:15:35 -0500, Chris Brennan wrote:
 > On Sat, Jan 1, 2011 at 10:20 PM, Ian Smith <smithi at nimnet.asn.au> wrote:
 > >  The bsdlabel lives in sector 1 (counting from 0) of the slice concerned,
 > > specifically the first 0x114 (276d) bytes, in the second sector of the
 > > boot blocks.  As noted above, in unsliced disks such as memstick.img
 > > that's sector 1 of the entire disk, but in ordinary sliced disks it's in
 > > sector 1 of the _slice_, so if you'd used (here using Chris' ad4)
 > >
 > >  dd if=/dev/zero of=/dev/ad4s1 oseek=1 bs=512 count=1
 > >
 > >
 > I would happily run this, but ad4s1 doesn't exist, and hasn't (that I know
 > of), I did do oseek=0 and oseek=1 on /dev/ad4 tho and that didn't change
 > anything, it still says it can't find /dev/ad4s1b (swap obviously)

On /dev/ad4, oseek=0 zeroes sector 0, the MBR including DOS partition 
(FreeBSD slice) table, so that would kill all the slice data, so sure, 
ad4s1 won't exist.  oseek=1 just zeroes an unused sector as we've seen.

What you _can_ do from that state is:

 dd if=/dev/zero of=/dev/ad4 oseek=63 count=8

which will remove the first 4K of (what will be) slice 1, in case 
there's a misconfigured bsdlabel there, for later.  I'm not convinced 
this is likely your problem, but it can't hurt before slice 1 exists (by 
virtue of having an entry in the MBR, when it should show up in /dev)

 > > At 6.x (and 7.x, I think) it could have been 'dangerously dedicated' ie
 > > unsliced .. which option has been removed in 8.x _except_ regarding the
 > > memstick.img (appearing as /dev/daXa) .. not half confusing, eh?
 > >
 > >
 > I actually noticed this today, I had issues writing 8.2BETA1 to a 2GB
 > MicroSD card, so I used a 2.5" external hard-drive and from the fixit prompt
 > I noticed that it wrote a 1gb partition for the BETA1 image and left the
 > rest of the desk untouched (ann 59gb of it).

Do you mean you dd'd the memstick.img to the external USB drive?  And 
that booted ok?  And sysinstall found it ok, as /dev/ad0a?  Details!

 > >  sysctl kern.geom.debugflags=16
 > >  dd if=/dev/zero of=/dev/ad4s1 bs=512 count=8
 > >
 > > will remove slice 1's boot blocks entirely, including the bsdlabel.

Given you've shown previously that s1 starts at sector 63, so will:

 sysctl kern.geom.debugflags=16
 dd if=/dev/zero of=/dev/ad4 oseek=63 count=8

 > > [excuse broken threading, but unless cc'd I have to reply to the digest]
 > I've been trying to keep you in my replies

Getting yours fine; that was re my reply to Mike's message.

 > but your down-under, so I don't get your replies till after 1am my 
 > time... Anywho, it's late and I need to be up in 8hrs, hopefully this 

Yeah North America is so yesterday from here (well, 16 hours for you :)

 > can be figured out ... I would hate for the disk to be defective in 
 > some way.

Of course that's not impossible, but you did say you'd installed some 
linux on it ok?  Clutching at straws, is there anything in your BIOS 
regarding different SATA modes you can play with? (No SATA disks here)

Something else you could try is W)riting the slice table + MBR out from 
the fdisk menu, then quit sysinstall and reboot.  You can do the same 
after labelling but before newfs'ing .. not generally recommended, but 
safe enough on a blank disk.

If you do the latter, you'll have to reenter your mount points later, so 
make a note of the order and size of partitions that you specified.

Hopefully somebody else has a take on all this, I'm out of ideas ..

cheers, Ian

More information about the freebsd-questions mailing list