From owner-freebsd-questions@FreeBSD.ORG Thu Feb 16 12:39:20 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC251065670 for ; Thu, 16 Feb 2012 12:39:20 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id DB9508FC1C for ; Thu, 16 Feb 2012 12:39:19 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [IPv6:2001:8b0:151:1:fa1e:dfff:feda:c0bb]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id q1GCdDaU024643 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Thu, 16 Feb 2012 12:39:13 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: OpenDKIM Filter v2.4.3 smtp.infracaninophile.co.uk q1GCdDaU024643 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1329395953; bh=jAPBtJAGOruCSArs/6b3g/MAeVvurUruGV3JX2BNfNU=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Cc; b=aFCk0SU7Pk4SA7Wcb3eFQl+hFyqUzA/BfoaiDrTOXBFi/4uSZMQh0NLu3Bn8uaTRu cB4Xjh/RghVZ+AmKPo/bTOCIXmNAO29RY9zFY7vJakViy0FToMcIyIcwBOT13KRq2n EVLf07tDtC6DvWBSX0bVKfRhU5sN0yVxveElvR6g= Message-ID: <4F3CF8E8.9050507@infracaninophile.co.uk> Date: Thu, 16 Feb 2012 12:39:04 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: In-Reply-To: X-Enigmail-Version: 1.3.5 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB8C321EE20BE3FF86415A2DA" X-Virus-Scanned: clamav-milter 0.97.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Subject: Re: Help! Drive failing in zpool X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 12:39:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB8C321EE20BE3FF86415A2DA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 16/02/2012 11:23, Andy Wodfer wrote: > I have a drive failing and it's a member of a zpool. Since I don't deal= > with these things every day I thought I ask for some help... :-) Well, the nice thing about ZFS is that it makes dealing with this sort of failure relatively painless. > I've already ordered a new drive which will arrive shortly, but I was > wondering if someone could guide me through the process of taking out a= > drive of the pool and replacing it with a new one and keep all the data= > intact? >=20 > Ie. >=20 > - put drive in offline mode > - remove drive > - insert new drive > - whatever needs to set it up > - add it to the zpool > run OK. First you need to identify the failing drive physically. Do you know which of the drives on your machine is ad1? Kind of important to get this right. Many servers will give you helpful hints by displaying error lights on broken drives, or you may be able to use something like iLO or iDRAC to turn on an indicator LED. Or you may be able to tell by other means. However you do it, be sure about this, as taking out one of the good drives by accident will probably crash your system. Nb. pro-tip: take some small sticky labels to the datacenter with you (the sort you get for those year-planner wall calendars are ideal, but anything will do) and mark the duff drive with them, on the drive caddy before you pull the drive and on the drive itself if you need to reuse the caddy. Now, I can see from your zpool status that you are just using raw disks, so no worries about partitioning or marking anything bootable. If you'ld built the system as described in eg. http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/RAIDZ1 so you were booting from this zpool, then there would be extra steps needed here, but you haven't so there aren't. So, first take the drive out of the zpool. This will result in the zpool state changing to DEGRADED: # zpool offline files ad1 Now physically extract the drive from the machine and replace it with your brand new one. If this is not a hot-swap system that will involve powering down and application of screwdrivers. If it is a hot-swap system, then you need to ensure the OS recognized the new drive. # dmesg Should show messages about 'ad1' near to the end. # atacontrol list should mention the new drive. To force the new drive to be registered, you could use: # atacontrol reinit ata0 but that will also reset ad0, and runs the risk of disruption of service. It might be better to reboot if the system won't pick up the new drive automatically. Now you can rebuild your zpool: # zpool replace files ad1 You should see instant disk activity, and zpool status will show the drive being resilvered. Eventually status will change to ONLINE. That's it. All done. > Btw, rebooting this server is not a problem if needed. That shouldn't be necessary, assuming that you have hot-swap drives. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@infracaninophile.co.uk Kent, CT11 9PW --------------enigB8C321EE20BE3FF86415A2DA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk88+PAACgkQ8Mjk52CukIzmWwCgiqivfHT8OuoLZXjstlx7HuFt 6aEAoI4XKtrkoZbSj3J+Vv3D1YH5YzBY =0v8e -----END PGP SIGNATURE----- --------------enigB8C321EE20BE3FF86415A2DA--