From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 26 21:06:18 2007 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67D9916A418 for ; Thu, 26 Jul 2007 21:06:18 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4C64013C4A6 for ; Thu, 26 Jul 2007 21:06:18 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 258641CC01C; Thu, 26 Jul 2007 13:50:42 -0700 (PDT) Date: Thu, 26 Jul 2007 13:50:42 -0700 From: Jeremy Chadwick To: Dag-Erling Sm?rgrav , Stephen Hocking , hackers@freebsd.org Message-ID: <20070726205042.GA4414@eos.sc1.parodius.com> References: <6300771b0707252356i3e902d6ch7919ddbb70d411e7@mail.gmail.com> <86abtj34va.fsf@ds4.des.no> <20070726175337.GA75432@voi.aagh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070726175337.GA75432@voi.aagh.net> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Subject: Re: FreeBSD & Hot pluggable disks (SATA?) 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: Thu, 26 Jul 2007 21:06:18 -0000 On Thu, Jul 26, 2007 at 06:53:37PM +0100, Thomas Hurst wrote: > * Dag-Erling Sm?rgrav (des@des.no) wrote: > > > It is a function of the disk controller and driver. AFAIK, the ata > > driver supports hot-plug as long as the SATA controller does. I > > believe most Promise and Intel ICH SATA controllers do, not sure about > > Sil or nVidia MCP. > > Both SiI and nForce's should support hot-swap, though if ata(4) actually > handles them correctly is another matter. > > I have an nForce 4 Pro board (a Tyan K8WE, CK804 chipset) which in > FreeBSD gracefully handles hot removal, but needs a reboot to correctly > recognise hot-plugged devices. I thought I'd filed a PR about it, but I > can't seem to find it... > > I also have an 8 port Marvell SATA controller (88SX6081) which needs an > atacontrol reinit to pick up new devices, but otherwise seems to work > fine. I recently had the joy of needing to hot-swap a disk in one of our running servers (Supermicro SuperServer 5015M-T, Intel ICH7 SATA controller). The server does have a hot-swap SATA backplane, and AHCI is enabled on the box (and reported by FreeBSD too). I moved all data off of the disk and umount'd it. Once our datacenter guy got there, I did an atacontrol detach ad6, which resulted in: subdisk6: detached ad6: detached I had our DC guy pull the carriage/disk, put the replacement, and re-insert it. I then did an atacontrol attach ad6, which resulted in: ad6: 238475MB at ata3-master SATA300 I was immediately able to see the drive, began newfs, mount, moved data back, and all was well. I like telling this incredibly boring story because both our DC guy and myself were amazed at the fact that it *actually worked*. He and I both deal with hardware and software "insanities" on a daily basis (at our day jobs), and we were expecting either the kernel to panic or the drive to simply not show up until a reinit or even a reboot. It's really nice when things *just work*, you know what I mean? Comparatively, at my home I have an Asus A8N-E (nForce CK804 SATA controller) with numerous disks in it. One recently went bad, and for "fun" I decided to go through the same procedure as above. It went well until the physical portion -- I disconnected the SATA cable without issue, but the instant I disconnected the SATA power cable, I heard all of the drives on the bus reset. I looked up at the console and found the machine had panic'd. I plugged in the new disk (SATA cable first, power 2nd) and again heard all the drives on the bus reset. After rebooting the box, the BIOS found the new disk as well as all the old ones, and of course FreeBSD did as well. I'm not sure why all the devices on the bus reset. Was this due to the lack of SATA hot-swap backplane? I really have no idea what those backplanes do/provide on purely an electronic (and electrical) level, so maybe what happened was normal for the scenario. If someone could clue me in here, I'd really appreciate it. I'm pretty sure FreeBSD panic'd because the existing (and mounted) disks which got reset disappeared from the bus; there's another -stable thread about what FreeBSD does when you pull hardware out from underneath it and it tries to access a device with a mounted filesystem. :-) An interesting/educational experience nonetheless. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |