From owner-freebsd-questions@FreeBSD.ORG Wed Aug 12 17:27:09 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 42FE71065672 for ; Wed, 12 Aug 2009 17:27:09 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr17.xs4all.nl (smtp-vbr17.xs4all.nl [194.109.24.37]) by mx1.freebsd.org (Postfix) with ESMTP id E30198FC43 for ; Wed, 12 Aug 2009 17:27:08 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr17.xs4all.nl (8.13.8/8.13.8) with ESMTP id n7CHR5oj099446; Wed, 12 Aug 2009 19:27:05 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id C2458BA9B; Wed, 12 Aug 2009 19:27:04 +0200 (CEST) Date: Wed, 12 Aug 2009 19:27:04 +0200 From: Roland Smith To: PJ Message-ID: <20090812172704.GA27066@slackbox.xs4all.nl> References: <20090811173211.6FE4D106567B@hub.freebsd.org> <20090812193008.F19821@sola.nimnet.asn.au> <4A82A8D9.30406@videotron.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <4A82A8D9.30406@videotron.ca> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org, Polytropon , Ian Smith , wmoran@potentialtech.com 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 17:27:10 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 12, 2009 at 07:34:49AM -0400, PJ wrote: > 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.=20 Is this the program you're talking about? http://store3.esellerate.net/store/ProductInfo.aspx?StoreIDC=3DSTR793615240= &SkuIDC=3DSKU9923428806&pc=3D I'm not an expert on harddisks, but the claims that this program makes seem too good to be true. I wonder what other on the list think of it?=20 You may also find the following link about data recovery enlightening: http://www.mjmdatarecovery.co.uk/data-recovery-articles/bad-sector-errors.h= tml Information encoding techniques on harddisks have changed dramatically over the years to help enable the ever increasing densities. The link to HDD regenerator talks about bad sectors showing. Current harddisks have a numb= er of spare sectors available so that they can remap the data from unreadable sectors, using the error correction bits to restore unreadable data. All th= is is done in the harddisk itself, without even being visible to the user. AFA= IK, a harddisk will only start showing re-allocated sectors in the SMART information after its spare sectors are exhausted. See [http://en.wikipedia.org/wiki/Bad_sector] If this is the case, the common advice it to decommission this drive ASAP. You should use 'smartctl' from the sysutils/smartmontools port to check if your harddisk is healthy or failing. 'smartctl -a /dev/' should g= ive complete information. Look at a line containing the text 'Reallocated_Sector_Ct'. If the last number on this line is greater than ze= ro, the disk has run out of spare sectors, and it is time to get a new disk. > 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.. :-) Yes. But probably not a problem with the boot sector. Because the machine found and executed the boot code (because it booted). And it succeeded in finding and loading the kernel (because it wrote a dump). Now it is importa= nt to know _why_ the kernel dumped core. It could be that the kernel image was corrupted on disk, pointing to a disk problem. But it can also be something else. So try and see if you can read the slice table with fdisk as described below. If that works, the slice table should be OK. > 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. If your boot sector is truly buggered, read the manual pages for the follow= ing utilities: - fdisk(8) - boot0cfg(8) You can re-install the boot code in sector 0 easily with FreeBSD's fdisk. E.g. if you are booting from the /dev/ad4 drive: 'fdisk -B /dev/ad4'. If you can boot from a FreeBSD livecd, try if you can read the slicetable correctly with fdisk to check if it is really damaged. Again assuming the b= ad drive is /dev/ad4, save the output of the following command to a file, and post the contents here. 'fdisk /dev/ad4'. A tip for the future. If you have a newly sliced disk, save the slice table= to a file with 'fdisk -p /dev/ad4 >slicetable-ad4.txt', and save this file away =66rom the computer. If you ever damage the slice table, you can restore it using the file that you saved with 'fdisk -f slicetable-ad4.txt -i /dev/ad4= '. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkqC+2gACgkQEnfvsMMhpyXLfwCgpj3LE9qtfiYkOftBQUp40vLy /eEAn0HM0zSsWdybnmAghS69lruyt+HC =ucY3 -----END PGP SIGNATURE----- --5vNYLRcllDrimb99--