From owner-freebsd-current@FreeBSD.ORG Sun Aug 20 20:55:28 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 5D5C916A4DA for ; Sun, 20 Aug 2006 20:55:28 +0000 (UTC) (envelope-from oberman@es.net) Received: from postal2.es.net (postal2.es.net [198.128.3.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id A44B443D55 for ; Sun, 20 Aug 2006 20:55:27 +0000 (GMT) (envelope-from oberman@es.net) Received: from ptavv.es.net (ptavv.es.net [198.128.4.29]) by postal2.es.net (Postal Node 2) with ESMTP (SSL) id YCX68018; Sun, 20 Aug 2006 13:55:18 -0700 Received: from ptavv.es.net (localhost [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id 4C78E45042; Sun, 20 Aug 2006 13:55:18 -0700 (PDT) To: "Daniel Eriksson" In-reply-to: Your message of "Sun, 20 Aug 2006 16:07:11 +0200." <4F9C9299A10AE74E89EA580D14AA10A605F5CD@royal64.emp.zapto.org> Date: Sun, 20 Aug 2006 13:55:18 -0700 From: "Kevin Oberman" Message-Id: <20060820205518.4C78E45042@ptavv.es.net> Cc: freebsd-current@freebsd.org 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 20:55:28 -0000 > Date: Sun, 20 Aug 2006 16:07:11 +0200 > From: "Daniel Eriksson" > Sender: owner-freebsd-current@freebsd.org > > > 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. There have been some excellent suggestions in this thread, but one simple detail looks like it's been over-looked. If the disk has marked the sector as bad, which it should have, and it there are redirection sectors available. a reboot is all that is required. After reboot the entire swap space will be unused and the first access to any sector will be a write. The sector will be remapped on any write attempt, so as soon as that sector is used after boot, it will be remapped to a spare sector and the error will be gone. No need to force a write to that sector. That said, using smartctl is an excellent suggestion. If it's just a random block failure, it's no big deal and smart should tell you if the problem is worse and it's time to go buy a new drive. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634 Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751