Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2001 10:47:50 +0100
From:      Nick Barnes <Nick.Barnes@pobox.com>
To:        questions@freebsd.org
Subject:   interpreting UFS hard error messages
Message-ID:  <397.992339270@thrush.ravenbrook.com>

next in thread | raw e-mail | index | archive | help
1. How should I interpret UFS hard error messages?

2. Is there any utility to allow me to explore filesystem layout?  For
instance, to figure out what a given block does?

I'm running 4.3-STABLE (last buildworld a few weeks ago).  I have a
big IBM disk as ad0 with a 20 GB partition ad0s1 used for FreeBSD.
I'm getting the following message:

> ad0s1f: hard error reading fsbn 8520063 of 65696-65711 (ad0s1 bn 8520063; cn 530 tn 89 sn 6)

I know that the right thing to do is to throw the disk away, but it's
not a critical machine and that seems a waste.  So I want to run
badsect and fsck, but I'm not sure which of the numbers here is the
sector number to give to badsect.  8520063 is not between 65696 and
65711, after all.

My interpretation is that the filesystem was attempting to read blocks
65696 to 65711 of this filesystem, and failed on a particular block
which is block number 8520063 in the overall partition (hence "ad0s1
bn 8520063").  So I'm guessing that I need to deduct the filesystem
start block number from 8520063 to get the file system block number to
give to badsect.

Well, disklabel says:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   f: 12582912  8388608    4.2BSD        0     0     0

And 8520063 - 8388608 = 131455.  Hmm.  Looks like there's a factor of
two out somewhere, since this is twice 65727.  That's still not quite
in the right range, but note that fdisk says:

> The data for partition 1 is:
> sysid 165,(FreeBSD/NetBSD/386BSD)
>     start 63, size 41929587 (20473 Meg), flag 80 (active)
>       beg: cyl 0/ sector 1/ head 1;
>       end: cyl 1023/ sector 63/ head 254

So maybe I want (8520063 - 8388608 - 63) / 2 = 65696.  That certainly
looks right.  But maybe it's not.  Help!  Surely there's a simple way
to interpret these messages.  It would be nice if the message had more
accurate information in the first place.  I've tried looking at
diskerr() in ufs_disksubr.c, but it's all Greek to me.

Nick Barnes

> # grep ad0 /var/run/dmesg.boot
> ad0: 43979MB <IBM-DTLA-307045> [89355/16/63] at ata0-master UDMA100
> Mounting root from ufs:/dev/ad0s1a
> # fdisk ad0
> ******* Working on device /dev/ad0 *******
> parameters extracted from in-core disklabel are:
> cylinders=5606 heads=255 sectors/track=63 (16065 blks/cyl)
> 
> Figures below won't work with BIOS for partitions not in cyl 1
> parameters to be used for BIOS calculations are:
> cylinders=5606 heads=255 sectors/track=63 (16065 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:
> sysid 165,(FreeBSD/NetBSD/386BSD)
>     start 63, size 41929587 (20473 Meg), flag 80 (active)
>       beg: cyl 0/ sector 1/ head 1;
>       end: cyl 1023/ sector 63/ head 254
> The data for partition 2 is:
> <UNUSED>
> The data for partition 3 is:
> <UNUSED>
> The data for partition 4 is:
> <UNUSED>
> # disklabel ad0s1
> # /dev/ad0s1c:
> type: ESDI
> disk: ad0s1
> label: 
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 2609
> sectors/unit: 41929587
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0         # milliseconds
> track-to-track seek: 0        # milliseconds
> drivedata: 0 
> 
> 8 partitions:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   a:  2097152        0    4.2BSD        0     0     0         # (Cyl.    0 - 130*)
>   b:  4194304  2097152      swap                      # (Cyl.  130*- 391*)
>   c: 41929587        0    unused        0     0               # (Cyl.    0 - 2609*)
>   e:  2097152  6291456    4.2BSD        0     0     0         # (Cyl.  391*- 522*)
>   f: 12582912  8388608    4.2BSD        0     0     0         # (Cyl.  522*- 1305*)
>   g: 20958067 20971520    4.2BSD        0     0     0         # (Cyl. 1305*- 2609*)
> # 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?397.992339270>