Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 13:27:49 +0200
From:      Paul Schenkeveld <fb-stable@psconsult.nl>
To:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Weird EINVAL readig *large* file
Message-ID:  <20030405132749.A2167@psconsult.nl>

next in thread | raw e-mail | index | archive | help
Hi All,

I'm about to clean and re-initialize a Maxtor 160GB disk that
shows a weird problem but I think I've found a bug in RELENG_4_7
somewhere so if preserving my disk can help conquer one more bug
I'm happy to wait a couple of days and help solve that bug.

Here's the story:

While upgrading from 4.3-STABLE to 4.7p4 and at the same time
reorganizing my vinum volumes I copied several (unmounted)
vinum volumes (ufs filesystems) to a large IDE disk using dd(1)
in order to be able to recreate my vinum volumes.

When I try to read back one of the saved images containing a
16GB filesystem, I get EINVAL somewhere half way the file.
I first discoverd this when I tried "sum /dev/vinum/arch" but
this happens with every command I use to read the file, even
with a small C program I wrote to just read the file in 8KB
chunks to verify this error.

The read(2) manual page gives the following explanation for
EINVAL:

    [EINVAL]	The pointer associated with d was negative.

which I am certain was absolutely not the case, at least in my
small test program.

There is no media error report in /var/log/messages (but if there
were I would expect EIO and not EINVAL).

A full fsck of the filesystem shows no error at all so either the
block allocations in the inode and indirect blocks are ok or fsck
fails to find out what's wrong.

Another image copy I made to another disk (same Maxtor model,
connected to the second ATA channel of the same controller)
reads fine though.

The IDE disk is a Maxtor 160GB disk:

    ad4: 156334MB <Maxtor 4G160J8> [317632/16/63] at ata2-master UDMA133

Connected to a Promise ATA133 controller:

    atapci0: <Promise TX2 ATA133 controller> port 0x3000-0x300f,
    0x3010-0x3013,0x3018-0x301f,0x3014-0x3017,0x3020-0x3027 mem
    0xf4200000-0xf4203fff irq 11 at device 7.0 on pci2

The fdisk entry for the disk is:

    /dev/ad4: 317632 cyl 16 hd 63 sec
    Part        Start        Size Type Flags
       1:          63   320172993 0xa5 0x80

The disklabel reads:

    # /dev/ad4s1c:
    ...
    8 partitions:
    #        size   offset    fstype   [fsize bsize bps/cpg]
      b:      265        0      swap                        # (Cyl. 0 - 0*)
      c: 320172993        0    unused        0     0        # (Cyl. 0 - 317631*)
      e: 320172728      265     vinum                       # (Cyl. 0*- 317631*)

and the vinum objects on this disk:

    D disk10                State: up       Device /dev/ad4s1e      Avail: 0/156334 MB (0%)
    V arch                  State: up       Plexes:       1 Size:        152 GB
    P arch.p0             S State: up       Subdisks:     1 Size:        152 GB
    S arch.p0.s0            State: up       PO:        0  B Size:        152 GB

All was done on an Intel L440GX based server (2x 700MHz P3)
running a 4.7p4 kernel (and userland):

    @(#)FreeBSD 4.7-RELEASE-p4 #2: Fri Feb 21 16:18:45 CET 2003

but later I upgraded to 4.7p10 and the results are the same.

Regards,

Paul Schenkeveld, Consultant
PSconsult ICT Services BV



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