From owner-freebsd-stable@FreeBSD.ORG Wed Dec 14 09:26:27 2011 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 5E4BB1065676 for ; Wed, 14 Dec 2011 09:26:27 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta11.emeryville.ca.mail.comcast.net (qmta11.emeryville.ca.mail.comcast.net [76.96.27.211]) by mx1.freebsd.org (Postfix) with ESMTP id 44E838FC0C for ; Wed, 14 Dec 2011 09:26:26 +0000 (UTC) Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta11.emeryville.ca.mail.comcast.net with comcast id 8xQt1i0021wfjNsABxSKl7; Wed, 14 Dec 2011 09:26:19 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta23.emeryville.ca.mail.comcast.net with comcast id 8xJa1i0061t3BNj8jxJbY5; Wed, 14 Dec 2011 09:18:35 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 9059B102C19; Wed, 14 Dec 2011 01:26:24 -0800 (PST) Date: Wed, 14 Dec 2011 01:26:24 -0800 From: Jeremy Chadwick To: "Patrick M. Hausen" Message-ID: <20111214092624.GA96153@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Stable Subject: Re: Hot-changing a failed HDD with ahci.ko 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: Wed, 14 Dec 2011 09:26:27 -0000 On Wed, Dec 14, 2011 at 09:29:52AM +0100, Patrick M. Hausen wrote: > Hi, all, > > while most cheap servers with SATA disks are not really hot-plug > capable, changing a failed disk (either gmirror or zfs) was possible > without a reboot by executing e.g. if ad4 failed: > > atacontrol detach ata2 > > atacontrol attach ata2 > > What is the proper equivalent for ahci, ada0 and camcontrol? None is needed: yank the disk, reinsert, wait a few seconds, done. Validation, with full output, hardware, etc: http://koitsu.wordpress.com/2010/07/22/freebsd-and-zfs-hot-swapping-sata-disks-with-ahci/ I've made videos to demonstrate this as well, but need to edit them and upload them. > Stop unit commands seem not to work with SATA disks, so I > tried: > > > -> system logs about lost device, so far so good > > camcontrol reset 1 > camcontrol devlist > -> disk still not there > camcontrol rescan 1 > -> command hangs > > shutdown -r now > -> system panics, eventually reboots Before you yanked the disk, were any non-ZFS filesystems mounted? This sounds similar to what happens if you were to yank a classic SATA disk from a non-AHCI system, or under ata(4), without detaching first. Or, on some systems, when SATA disks are yanked without use of a hot-swap backplane. > I can provide details about the panic if someone is interested, > but maybe there is a proper procedure already, which I simply missed. > > System is RELENG_8_2 amd64. > ahci0: port 0xf090-0xf097,0xf080-0xf083,0xf070-0xf077,0xf060-0xf063,0xf020-0xf03f mem 0xfb921000-0xfb9217ff irq 19 at device 31.2 on pci0 > ada0 at ahcich0 bus 0 scbus1 target 0 lun 0 > ada0: ATA-8 SATA 1.x device > ada0: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes) > ada0: Command Queueing enabled > ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C) > ada1 at ahcich1 bus 0 scbus2 target 0 lun 0 > ada1: ATA-8 SATA 1.x device > ada1: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes) > ada1: Command Queueing enabled > ada1: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C) You might try booting RELENG_9 (which has ahci.ko as the default, so no need to mess about) on a LiveCD or equivalent and attempt the same thing. I'm left wondering if there's some stuff in RELENG_8 (not a typo compared to the above RELENG_9 reference) that you do not have in RELENG_8_2. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |