From owner-freebsd-questions@FreeBSD.ORG Fri Feb 23 07:37:27 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB99716A404 for ; Fri, 23 Feb 2007 07:37:27 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.freebsd.org (Postfix) with ESMTP id B1EE913C491 for ; Fri, 23 Feb 2007 07:37:23 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.5) with SMTP id SAA28362; Fri, 23 Feb 2007 18:37:06 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Fri, 23 Feb 2007 18:37:06 +1100 (EST) From: Ian Smith To: Marty Landman In-Reply-To: <20070223054641.12DD316A41B@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org, Derek Ragona Subject: Re: input/output error on hd 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: Fri, 23 Feb 2007 07:37:28 -0000 In freebsd-questions Digest, Vol 166, Issue 12 At Message: 15 On Thu, 22 Feb 2007 18:12:48 -0500 Marty Landman wrote: > Thanks Derek, > > I tried deleting and recreating the one slice on that drive in sysinstall, > also rewriting the boot label. Didn't seem to help as shown: It's hard to guess if you don't show us the precise commands you issued, or at least the data you gave to sysinstall, and what you got back. > %sudo fdisk ad1cs1 > ******* Working on device /dev/ad1cs1 ******* > parameters extracted from in-core disklabel are: > cylinders=486332 heads=16 sectors/track=63 (1008 blks/cyl) > > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=486332 heads=16 sectors/track=63 (1008 blks/cyl) > > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > > The data for partition 2 is: > > The data for partition 3 is: > > The data for partition 4 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 0, size 50000 (24 Meg), flag 80 (active) > beg: cyl 0/ head 0/ sector 1; > end: cyl 1023/ head 254/ sector 63 Apart from the fact that 'ad1cs1' is a nonsense, fdisk run on slices always shows garbage, in this case indicating that only slice 4 is in use, with a nonsense size. In fact, I get _exactly_ your above rubbish partition report from running 'fdisk ad0s4' or 'fdisk ad0s2' - both of which are FreeBSD slices - and other types of rubbish on ad0s1 (DOS) and ad0s3 (different DOS) .. fdisk just blindly reports what it finds in binary, scarcely checking for consistency. 'fdisk ad0' (here) shows the Right Stuff. So just show 'fdisk ad1' to see the disk's partition (slice) table (which may be damaged, but it's the only one you're interested in). If 'fdisk ad1' isn't showing any sensible data for 'partition 1' (ad1s1) then your boot sector is hosed. > %sudo fsck /dev/ad1cs1 > fsck: Could not determine filesystem type > %sudo fsck /dev/ad1c > fsck: exec fsck_unused for /dev/ad1c in /sbin:/usr/sbin: No such file or > directory You shouldn't be doing any of this with the 'c' partition, which is meant to cover the whole disk, but doesn't describe any of its slices. I gather you think your data should be on ad1s1. Does 'bsdlabel ad1s1' say anything sensible? If not, does bsdlabel ad1s2, ad1s3 or ad1s4, if fdisk ad1 shows anything in s2, s3 or s4. I wouldn't be running fsck (without the -n switch) or bsdlabel (with the -e switch) until you're pretty sure of what's going on where - though I gather it's a bit late for that sort of advice :( > %sudo mount /dev/ad1cs1 /hoss > mount: /dev/ad1cs1: Input/output error > %sudo mount /dev/ad1c /hoss > mount: /dev/ad1c on /hoss: incorrect super block > %sudo dd if=/dev/ad1s1 of=/tmp/scratch bs=512 count=1 skip=131 > dd: /dev/ad1s1: Input/output error > 0+0 records in > 0+0 records out > 0 bytes transferred in 1.199710 secs (0 bytes/sec) As you mentioned elsewhere, you appear to have a bunch of bad blocks early on this disk. They may or may not be critical to recovering the rest of your data, but with all this experimental poking around, things don't look too good. Have you a spare drive you can dd this one to, in its current state? > %sudo dd if=/dev/ad1s1 of=/tmp/scratch bs=512 count=1 skip=127 > 1+0 records in > 1+0 records out > 512 bytes transferred in 0.018295 secs (27986 bytes/sec) > %sudo dd if=/dev/ad1s1 of=/tmp/scratch bs=512 count=1 skip=144 > 1+0 records in > 1+0 records out > 512 bytes transferred in 0.024593 secs (20819 bytes/sec) > %sudo dd if=/dev/ad1s1 of=/tmp/scratch bs=512 count=1 skip=143 > dd: /dev/ad1s1: Input/output error > 0+0 records in > 0+0 records out > 0 bytes transferred in 1.319451 secs (0 bytes/sec) > % > > Wonder why it renamed my slice from ad1s1c to ad1cs1, and what I can do from > here. Which 'it' do you mean? ad1cs1 makes no sense at all, and ad1s1c you shouldn't usually be messing with at all (as it says, don't edit). What does 'ls -l /dev/ad1*' have to say? And please don't top-post .. > Marty > > On 2/22/07, Derek Ragona wrote: > > > > You may have lost the partition table. You can try repartitioning the > > drive but do NOT do a newfs. You can easily try it in sysinstall. > > > > -Derek Yes, if you know precisely how the disk was partitioned before, which is perhaps dubious in this case .. hopefully Marty saved a copy of the boot sector for each disk earlier with boot0cfg -f ? Marty, if you don't mind reposting what I suppose you did earlier, show us these (all non-destructive): # fdisk ad1 # bsdlabel ad1s1 (or whatever slice 1-4 it may be, or try them all) # boot0cfg -v ad1 Cheers, Ian