From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 21 23:09:04 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5067A16A41F for ; Mon, 21 Nov 2005 23:09:04 +0000 (GMT) (envelope-from marcin@studio4plus.com) Received: from pe78.opole.sdi.tpnet.pl (pe78.opole.sdi.tpnet.pl [217.96.240.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A32A43D58 for ; Mon, 21 Nov 2005 23:09:03 +0000 (GMT) (envelope-from marcin@studio4plus.com) Received: from [81.219.217.131] (helo=[192.168.0.101]) by pe78.opole.sdi.tpnet.pl with esmtpa (Exim 4.52 (FreeBSD)) id 1EeKmU-000C73-2Q for freebsd-hackers@freebsd.org; Tue, 22 Nov 2005 00:09:02 +0100 Message-ID: <43825384.1070807@studio4plus.com> Date: Tue, 22 Nov 2005 00:08:52 +0100 From: Marcin Simonides User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051111) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: VIA 6420 RAID 0 problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2005 23:09:04 -0000 I have (had?) two issues, perhaps connected: (I posted a question to freebsd-questions about it some time ago. It contains some additional information: http://lists.freebsd.org/pipermail/freebsd-questions/2005-November/103991.html) The first one is a problem with RAID 0, where ar0 device shows size of one disk instead of the whole array (others report the same problem): atapci0: port 0xec00-0xec07,0xe800-0xe803,0xe400-0xe407,0xe000-0xe003,0xdc00-0xdc0f,0xd800-0xd8ff irq 20 at device 15.0 on pci0 [...] ad0: 29314MB at ata0-master UDMA100 ad4: 76319MB at ata2-master SATA150 ad6: 76319MB at ata3-master SATA150 ar0: 76319MB status: READY ar0: disk0 READY using ad4 at ata2-master ar0: disk1 READY using ad6 at ata3-master I could not access slices that started past the first half of array. After trying different things and settings with sysinstall and linux-fdisk port I inspected src/sys/dev/ata/ata-raid.c and in ata_raid_via_read_meta() changed a line: switch (meta->type & VIA_T_MASK) { case VIA_T_RAID0: raid->type = AR_T_RAID0; raid->width = meta->stripe_layout & VIA_L_MASK; - raid->total_sectors = meta->total_sectors; + raid->total_sectors = meta->total_sectors * raid->width; break; to multiply the number of total_sectors by the number of disks (I guess that's what raid->width stands for). I don't know if it is the right thing to do, it just seemed a reasonable fix :) It works fine for me. I can access (read-write) a FAT32 slice that starts near the end of the array and the data is ok, can be read in FreeBSD and Windows with VIA's drivers. A UFS2 partition at the beginning of the array which I use for /usr also works fine, as before the change in kernel, so I think I haven't broken anything, at least for my configuration. Can anybody comment on it? Or maybe I just should send a PR? The other, perhaps connected with this, issue is that I lost an extended partition while creating FreeBSD partition. It had happened before I started trying to fix the size problem described above. After slicing the newly created RAID 0 array with sysinstall and installing Windows, formatting NTFS and FAT slices (with Windows) I created BSD partitions on the first slice and lost the extended partition (slice). (a more detailed description of what I did is in the original posting to freebsd-questions). Today, after the change in kernel, I have removed FreeBSD partitions from the first slice and recreated them (with some differences). Nothing wrong happened. Could this be connected with the bug in VIA ata raid driver? Or maybe it was just a coincidence and/or was entirely my fault? -- Marcin Simonides