From owner-freebsd-current@FreeBSD.ORG Sun Aug 20 14:07:13 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 104E916A4DA for ; Sun, 20 Aug 2006 14:07:13 +0000 (UTC) (envelope-from daniel_k_eriksson@telia.com) Received: from pne-smtpout2-sn2.hy.skanova.net (pne-smtpout2-sn2.hy.skanova.net [81.228.8.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2600443D58 for ; Sun, 20 Aug 2006 14:07:12 +0000 (GMT) (envelope-from daniel_k_eriksson@telia.com) Received: from royal64.emp.zapto.org (195.198.193.104) by pne-smtpout2-sn2.hy.skanova.net (7.2.075) id 44A2F19F00AD3E91 for freebsd-current@freebsd.org; Sun, 20 Aug 2006 16:07:11 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Content-class: urn:content-classes:message Date: Sun, 20 Aug 2006 16:07:11 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Message-ID: <4F9C9299A10AE74E89EA580D14AA10A605F5CD@royal64.emp.zapto.org> In-Reply-To: <44E83900.4020108@inse.ru> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Avoiding bad sectors? Thread-Index: AcbES4BngYbYnSnzSf20y7mLMr+cKAAFQ9wg From: "Daniel Eriksson" To: Subject: RE: Avoiding bad sectors? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Aug 2006 14:07:13 -0000 First thing you should do is run a SMART selftest on the device using smartmontools: smartctl -t long /dev/adX Poll the status of the selftest using: smartctl -a /dev/adX until the selftest has finished (an hour or two) or aborted. This can be done while in multiuser mode, but beware that disc accesses will be slower than usual. If you want to "fix" the problem and avoid downtime, then move swap to another slice (possibly an inode-backed md device, if that is possible) and fill the bad slice using 'dd'. Not sure if taking the data from /dev/random instead of /dev/zero makes any difference, but it will not hurt you other than by adding some time to the operation. Once you've written to the bad slice you probably want to re-run the SMART selftest to make sure it passes without any more failures. /Daniel Eriksson