From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 25 16:53:43 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F5C1065704 for ; Tue, 25 Nov 2008 16:53:43 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from arcturus.maxiscale.com (arcturus.maxiscale.com [76.231.178.136]) by mx1.freebsd.org (Postfix) with ESMTP id C0DE58FC1D for ; Tue, 25 Nov 2008 16:53:42 +0000 (UTC) (envelope-from psteele@maxiscale.com) X-ASG-Debug-ID: 1227632001-2bb000000000-P5m3U7 X-Barracuda-URL: http://10.100.1.25:8000/cgi-bin/mark.cgi Received: from polaris.maxiscale.com (localhost [127.0.0.1]) by arcturus.maxiscale.com (Spam Firewall) with ESMTP id 9AEF530BEF for ; Tue, 25 Nov 2008 08:53:21 -0800 (PST) Received: from polaris.maxiscale.com (polaris.maxiscale.com [10.100.1.24]) by arcturus.maxiscale.com with ESMTP id Q4c0wIOI6XOpTYbT for ; Tue, 25 Nov 2008 08:53:21 -0800 (PST) X-ASG-Whitelist: Client X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 X-ASG-Orig-Subj: Hot swapping SATA drives Date: Tue, 25 Nov 2008 08:53:20 -0800 Message-ID: <2ACA3DE8F9758A48B8BE2C7A847F91F240CD5E@polaris.maxiscale.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Hot swapping SATA drives Thread-Index: AclPHlImUwTanoxHS9GlWHcygFWntQ== From: "Peter Steele" To: X-Barracuda-Connect: polaris.maxiscale.com[10.100.1.24] X-Barracuda-Start-Time: 1227632003 X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at maxiscale.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Hot swapping SATA drives 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: Tue, 25 Nov 2008 16:53:43 -0000 I've done some searches regarding FreeBSD's 7 support for the hot swapping of SATA drives and the general consensus appears that it *is* supported, but not necessarily with all drive models/brands. In our own testing, we've discovered that our Seagate 250GB drives cannot be hot swapped in our servers. The system appears to sense when they are removed but not when they are reinserted, and we've had numerous panics experimenting with them. =20 We also have some Western Digital drives, and these fare much better. FreeBSD appears to recognize when these drives are removed and inserted. If we have a WD configured as part of a geom mirror, the geom driver automatically re-inserts a previously configured drive as soon as it is plugged in. It isn't even necessary to do an atacontrol attach/detach. =20 However, even with the Western Digital drive, there are issues. In particular, if there are any mounted file systems on a drive when it is removed, attempting to unmount the file systems after it has been removed usually leads to a kernel panic, not necessarily immediately but shortly afterwards. I've tried the latest 7.0 patch level, p6, and the panics appear to have been fixed, but there are still problems. =20 If a drive dies on us, we want to be able to close existing file handles and allow the new drive to take over. But what we've experienced is that even a "umount -f" will not umount a file system if the drive has been pulled. And as I type this, I have a system in the lab that is completely frozen after a drive pull test. No panic, no reboot, it's just hung up solid. =20 Why does FreeBSD panic/freeze instead of simply issuing an I/O error, and why is there no way to force open file handles to close when a drive is pulled. The implication is that if a drive was to suddenly die on a live system, even if we have gmirror configured for HA, the system will likely panic or freeze and we'll have to reboot. We have software that detects when a drive disappears, but if the system is going to end up having to be rebooted, our detection code isn't going to do us much good. =20 Is there any solution to this? Can a server be built around FreeBSD that supports hot swappable SATA drives? =20