From owner-freebsd-stable@FreeBSD.ORG Fri Jan 22 18:28:37 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC62106568B for ; Fri, 22 Jan 2010 18:28:37 +0000 (UTC) (envelope-from korvus@comcast.net) Received: from mx04.pub.collaborativefusion.com (mx04.pub.collaborativefusion.com [206.210.72.84]) by mx1.freebsd.org (Postfix) with ESMTP id C92B28FC16 for ; Fri, 22 Jan 2010 18:28:36 +0000 (UTC) Received: from reflector.ws.pitbpa0.priv.collaborativefusion.com ([206.210.89.202]) by mx04.pub.collaborativefusion.com (StrongMail Enterprise 4.1.1.4(4.1.1.4-47689)); Fri, 22 Jan 2010 13:54:51 -0500 X-VirtualServerGroup: Default X-MailingID: 00000::00000::00000::00000::::24 X-SMHeaderMap: mid="X-MailingID" X-Destination-ID: freebsd-stable@freebsd.org X-SMFBL: ZnJlZWJzZC1zdGFibGVAZnJlZWJzZC5vcmc= Message-ID: <4B59EE52.8050400@comcast.net> Date: Fri, 22 Jan 2010 13:28:34 -0500 From: Steve Polyack User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100114 Thunderbird/3.0 MIME-Version: 1.0 To: Freddie Cash References: <4B55D9D4.1000008@FreeBSD.org> <4B597CBB.5040900@omnilan.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD-Current , FreeBSD Stable Subject: Re: Pack of CAM improvements X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 18:28:37 -0000 On 01/22/10 11:48, Freddie Cash wrote: > On Fri, Jan 22, 2010 at 2:23 AM, Harald Schmalzbauer< > h.schmalzbauer@omnilan.de> wrote: > > >> Alexander Motin schrieb am 19.01.2010 17:12 (localtime): >> ... >> >> Patch can be found here: >> >>> http://people.freebsd.org/~mav/cam-ata.20100119.patch >>> >>> Feedback as always welcome. >>> >>> >> Again, thanks a lot for your ongoing great work! >> The patch doesn't cleanly apply with vpo, but I don't use vpo so I didn't >> care. >> Otherwise I couldn't find any problems. >> The system detects reinserted SATA drives on ICH9 fine. >> >> This was tested on a zfs backup server which went to the backbone >> yesterday, so I can't physically remove any devices any more for testing... >> >> But I had some questions about zfs raidz states. I think that isn't a >> matter of atacam but if I removed one disk, zpool status still showed me the >> ada3 device "online". >> After reinserting (and proper detection/initialisazion with cam, ada3 was >> present again) and zpool clean, it set the devicea as UNAVAIL sinve I/O >> errors. >> I coudn't get the device into the pool again, no matter what I tried. >> Only rebooting the machine helped. Then I could clean and scrub. >> >> What are the needed steps to provide a reinsterted hard disk to geom? With >> the latest patches I don't need to issue any reset/rescan comman, right? >> So it's a zfs problem, right? My mistake in understanding? >> >> In my testing of pulling drives at random (using a 3Ware 9550SXU or 9650SE >> > controller), you have to "zpool offline " while the drive is > unplugged, before you can re-insert the same disk or a different disk. > Without doing that step, it's very hard to re-insert the same disk, or > replace it with a new one, without rebooting. > > Took me a couple of reboots and drive replacements before I figured that one > out. :) > > I think you can do it without the 'zpool offline ' command; I may be wrong, but I believe you can use 'zpool replace' to accomplish what you're trying to do. i.e. if you have a bad drive ada3, and take it out, then replace it with a new disk, you can issue a 'zpool replace /dev/ada3 /dev/ada3' (yes, the same device is specified twice). ZFS should recognize that its a different disk and/or that it is lacking ZFS metadata and begin to resilver the pool onto the new device. If you watch 'zfs status' in the process you'll see something like: raidz1 DEGRADED 0 0 0 label/ada4 ONLINE 0 0 0 12.4M resilvered label/ada5 ONLINE 0 0 0 12.4M resilvered label/ada6 ONLINE 0 0 0 12.3M resilvered replacing DEGRADED 0 0 0 label/ada3/old UNAVAIL 0 595 0 cannot open label/ada3 ONLINE 0 0 0 9.74G resilvered Try it out and let me know if it works for you.