From nobody@FreeBSD.org  Sun Oct 13 05:57:14 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0466C37B401
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Oct 2002 05:57:14 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 993C843E88
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Oct 2002 05:57:13 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9DCvC7R057892
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Oct 2002 05:57:12 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.6/8.12.6/Submit) id g9DCvCN0057891;
	Sun, 13 Oct 2002 05:57:12 -0700 (PDT)
Message-Id: <200210131257.g9DCvCN0057891@www.freebsd.org>
Date: Sun, 13 Oct 2002 05:57:12 -0700 (PDT)
From: Pawel Malachowski <pawmal@unia.3lo.lublin.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Filesystem corruption with ata(4) software-raid on HPT370.
X-Send-Pr-Version: www-1.0

>Number:         44006
>Category:       kern
>Synopsis:       Filesystem corruption with ata(4) software-raid on HPT370.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 13 06:00:04 PDT 2002
>Closed-Date:    Mon May 05 02:50:56 PDT 2003
>Last-Modified:  Mon May  5 11:50:16 PDT 2003
>Originator:     Pawel Malachowski
>Release:        4.7-RELEASE
>Organization:
ZiN
>Environment:
>Description:
      I've created ata(4) software-raid with HPT370 ATA-RAID controller and two MAXTOR 6L040J2 (740X) 40GB hard drives. After that, problem appeared:

PARTIALLY ALLOCATED INODE I=7595634
UNEXPECTED SOFT UPDATE INCONSISTENCY

CLEAR? [yn] y

PARTIALLY ALLOCATED INODE I=7595638
UNEXPECTED SOFT UPDATE INCONSISTENCY

CLEAR? [yn] y

** Phase 2 - Check Pathnames
UNALLOCATED  I=7595634  OWNER=root MODE=0
SIZE=0 MTIME=Jan  1 01:00 1970
NAME=/chroot/cvsup/home/ncvs/ports/games/mangband/files

UNEXPECTED SOFT UPDATE INCONSISTENCY

REMOVE? [yn] y

** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
LINK COUNT DIR I=7595633  OWNER=9012 MODE=40775
SIZE=512 MTIME=Oct 13 13:49 2002  COUNT 3 SHOULD BE 2
ADJUST? [yn] y

UNREF FILE  I=7599504  OWNER=9012 MODE=100444
SIZE=2026 MTIME=Oct  2 06:50 2002

NO lost+found DIRECTORY
CREATE? [yn] y

UNREF FILE  I=7599505  OWNER=9012 MODE=100444
SIZE=1770 MTIME=Oct  2 06:50 2002
RECONNECT? [yn] y

UNREF FILE  I=7599506  OWNER=9012 MODE=100444
SIZE=1024 MTIME=Oct  2 06:50 2002
RECONNECT? [yn] y

UNREF FILE  I=7599507  OWNER=9012 MODE=100444
SIZE=1952 MTIME=Jan 16 16:27 2001
RECONNECT? [yn] y

** Phase 5 - Check Cyl groups
SUMMARY INFORMATION BAD
SALVAGE? [yn] y

BLK(S) MISSING IN BIT MAPS
SALVAGE? [yn] y

FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y

I've removed ata-raid (ar0), mounted filesystems from first HDD (ad4), fsck, stressed, and everyting was OK (no such poblems). Then, I've mounted filesystems from second HDD (ad6), fsck, stressed, and everyting was OK, too. So, my hardware isn't faulty.
Then I've copied one drive to another (using dd or HPT BIOS), created ata-raid and after few hours my filesystems is in inconsistent state, again.
CPU cooling is OK and memory is well tested and reportd to be good.
This looks to be related with write operation on ar0, software ata-raid device.
>How-To-Repeat:
      Create ata-raid on identical hard disks using dd+atacontrol or HPT BIOS. Run complete `make buildworld' 2-4x times. After hard working filesystem is corrupted and `make buildworld' fails.
>Fix:
      Don't know.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon May 5 02:48:15 PDT 2003 
State-Changed-Why:  
You cannot just dd one disk to another and then create a RAID ontop of that. 

You need to create the RAID *before* you create (disklabel newfs) your filesystems. 

What you encounter is problems because you fool the system into using a 
mirror where the two parts are almost but not entirely identical. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=44006 

From: "Pawel Malachowski" <pawmal@unia.3lo.lublin.pl>
To: "=?ISO-8859-2?Q?S=F8ren_Schmidt?=" <sos@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/44006: Filesystem corruption with ata(4) software-raid on HPT370.
Date: Mon, 05 May 2003 20:47:28 +0200

 On 5 May 2003 at 2:50, Sren Schmidt wrote:
 
 > Synopsis: Filesystem corruption with ata(4) software-raid on HPT370.
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: sos
 > State-Changed-When: Mon May 5 02:48:15 PDT 2003
 > State-Changed-Why: 
 > You cannot just dd one disk to another and then create a RAID ontop of that.
 > 
 > You need to create the RAID *before* you create (disklabel newfs) your filesystems.
 > 
 > What you encounter is problems because you fool the system into using a
 > mirror where the two parts are almost but not entirely identical.
 
 I was not clear, ATA-RAID was created before installing system.
 Filesystem was getting corrupted, so I've tried to synchronize
 disks using HPT BIOS. The problem was still there so _then_ I've
 decided to copy disks using dd.
 Of course system never complained me about any inconsistence
 between two disks in RAID1 (when data on disk1 and disk2 are
 known to be different, shouldn't array be degraded?).
 
 However, I think this PR should stay closed cause I know machines using
 HPT370 without such problems -- I suspect my card was broken somehow.
 I simply removed that HPT controller from my PC and I can't verify that
 right now.
 
 
 -- 
 Pawel Malachowski
 
>Unformatted:
