From owner-freebsd-questions@FreeBSD.ORG Wed Aug 12 10:18:36 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2816F1065673 for ; Wed, 12 Aug 2009 10:18:36 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [220.233.188.227]) by mx1.freebsd.org (Postfix) with ESMTP id 95A178FC41 for ; Wed, 12 Aug 2009 10:18:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id n7C9m3Kr032199; Wed, 12 Aug 2009 19:48:04 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Wed, 12 Aug 2009 19:48:02 +1000 (EST) From: Ian Smith To: Polytropon In-Reply-To: <20090811173211.6FE4D106567B@hub.freebsd.org> Message-ID: <20090812193008.F19821@sola.nimnet.asn.au> References: <20090811173211.6FE4D106567B@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: PJ , wmoran@potentialtech.com, freebsd-questions@freebsd.org Subject: Re: boot sector f*ed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 10:18:36 -0000 On Tue, 11 Aug 2009 17:52:29 +0200 Polytropon wrote: > On Tue, 11 Aug 2009 09:34:13 -0400, PJ > 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