From owner-freebsd-questions@FreeBSD.ORG Wed Aug 12 11:34:50 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 7D1C91065674 for ; Wed, 12 Aug 2009 11:34:50 +0000 (UTC) (envelope-from af.gourmet@videotron.ca) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.freebsd.org (Postfix) with ESMTP id 54E6E8FC1F for ; Wed, 12 Aug 2009 11:34:50 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=UTF-8 Received: from [192.168.0.51] ([96.21.103.185]) by VL-MH-MR002.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with ESMTP id <0KO900B79HI1C890@VL-MH-MR002.ip.videotron.ca> for freebsd-questions@freebsd.org; Wed, 12 Aug 2009 07:34:49 -0400 (EDT) Message-id: <4A82A8D9.30406@videotron.ca> Date: Wed, 12 Aug 2009 07:34:49 -0400 From: PJ User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) To: Ian Smith References: <20090811173211.6FE4D106567B@hub.freebsd.org> <20090812193008.F19821@sola.nimnet.asn.au> In-reply-to: <20090812193008.F19821@sola.nimnet.asn.au> Cc: Polytropon , 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 11:34:50 -0000 Ian Smith wrote: > 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 > Thanks, Ian... I'm actually at the stage of doing the save/copy/transfer or whatever you can call it: here's what I am thinking and on which I need clarification. I ran HDD regenerator and it immediately flagged the very first sector as being Bad. On bootint, just before the crash, the boot process started... hesitated, lurched forward, hesitated and then proceeded to load only some minutes later closing down with a 177mb dump. I knew then there was a problem.. :-) I have a 2nd disk just checked (with the regenerator - 12 hrs waiting on 2.4ghz cpu). If, indeed, the boot sector is the only thing mucked up, I should be able to copy the rest onto the 2nd(target) disk NP. The question, then, is how to deal with the boot sector. As I understand it, the boot sector has the partition information needed to run things for the rest of the disk. So, copying the damaged source disk will not give me the boot sector needed. I happen to have a another instance of 7.2 installed on a smaller disk but that boot sector, obviously will not be quite right, right? I presume that I can just boot up the spare 7.2 disk, do the dd stuff from source to target and we have stage 1 done. I get the impression to get this second stage (the boot stuff) I should do a minimal setup of the original configuration on a third disk the same size as the source and then copy the boot sector to the tartget. If for some reason, I haven't got the slices/partitions right, then I can just redo the whole shebang until I've got it right. A little tortured, but could work, or have I got it wrong? Of course, if there is a more elegant and simpler solution, shoot ! TIA PJ