Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2012 12:39:04 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: Help! Drive failing in zpool
Message-ID:  <4F3CF8E8.9050507@infracaninophile.co.uk>
In-Reply-To: <CABgB0xQWWs6O3Zf4gSS%2BEGY95L3f_%2BtEq1hDt2f-R9Zp8nJsWw@mail.gmail.com>
References:  <CABgB0xQWWs6O3Zf4gSS%2BEGY95L3f_%2BtEq1hDt2f-R9Zp8nJsWw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F3CF8E8.9050507>