boot sector f*ed

Ian Smith smithi at nimnet.asn.au
Wed Aug 12 10:18:36 UTC 2009


On Tue, 11 Aug 2009 17:52:29 +0200 Polytropon <freebsd at edvax.de> wrote:
 > On Tue, 11 Aug 2009 09:34:13 -0400, PJ <af.gourmet at videotron.ca> 
 > wrote: > I've got another disk about the same size on the machine and 
 > I'm > wonderiing how could I transfer the whole shebang to it?
 > 
 > Maybe an 1:1 copy using dd with a bs=1m would work.

Maybe it would, if the new disk size is >= the old one.

 > > Would doing a minimum 7.2 install be enough, followed by copying 
 > all the > slices to the corresponding slices on the new disk? > I'm 
 > thinking of mounting the broken drive on the new one and then > 
 > copying... does that sound about right?
 > 
 > No. Does not. :-)
 > 
 > The proper way of doing this - or at least ONE of the proper ways - 
 > is to use the intended tools for this task. These are dump and 
 > restore.
 > 
 > First of all, you use a FreeBSD live system (such as FreeSBIE) or the 
 > livefs CD of the FreeBSD OS to run the OS. The goal is: Most minimal 
 > interaction with the drives.

Good principles, but ..

 > Let's assume ad0 is your source disk and ad1 the target disk.
 > 
 > You can use the sysinstall tool to slice and partition the target 
 > disk. You can create the same layout as on the source disk. Of 
 > course, using tools like bsdlabel and newfs is valid, too. If you're 
 > done, things go like this:
 > 
 > 1. Check the source.
 > 
 > 	# fsck /dev/ad0s1a /dev/ad0s1e /dev/ad0s1f /dev/ad0s1g 
 > /dev/ad0s1h

Er, from PJ's original message (and the subject line) the boot sector, 
sector 0, is hosed.  So the partition/slice table is hosed, or at least 
untrustworthy.  So what then can /dev/ad0s1a and the others refer to?

dd may indeed be the best way to at least get a raw copy of the existing 
disk.  After which perhaps the boot sector can be rewritten with the 
right values (if available?) so that such as fsck and dump can proceed.

cheers, Ian


More information about the freebsd-questions mailing list